1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-16 04:56:58 +00:00

A ton of stuff was done to finalize the app for use

This commit is contained in:
Jacob Cody Wimer
2014-01-25 05:28:42 -05:00
parent 7f8718af35
commit c5a7bc3815
45 changed files with 889 additions and 22 deletions

View File

@@ -0,0 +1,31 @@
<%= form_for(@mat) do |f| %>
<% if @mat.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@mat.errors.count, "error") %> prohibited this mat from being saved:</h2>
<ul>
<% @mat.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
<% if @tournament_field %>
<%= f.hidden_field :tournament_id, :value => @tournament_field %>
<% else %>
<div class="field">
<%= f.label 'Tournament' %><br>
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing mat</h1>
<%= render 'form' %>
<%= link_to 'Show', @mat %> |
<%= link_to 'Back', mats_path %>

View File

@@ -0,0 +1,29 @@
<h1>Listing mats</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Tournament</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= mat.name %></td>
<td><%= mat.tournament_id %></td>
<td><%= link_to 'Show', mat %></td>
<td><%= link_to 'Edit', edit_mat_path(mat) %></td>
<td><%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Mat', new_mat_path %>

View File

@@ -0,0 +1,4 @@
json.array!(@mats) do |mat|
json.extract! mat, :id, :name, :tournament_id
json.url mat_url(mat, format: :json)
end

View File

@@ -0,0 +1,5 @@
<h1>New mat</h1>
<%= render 'form' %>
<%= link_to 'Back', mats_path %>

View File

@@ -0,0 +1,13 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @mat.name %>
</p>
<p>
<strong>Tournament:</strong>
<%= @mat.tournament_id %>
</p>
<%= link_to 'Edit', edit_mat_path(@mat) %> |

View File

@@ -0,0 +1 @@
json.extract! @mat, :id, :name, :tournament_id, :created_at, :updated_at