1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 14:36:59 +00:00

Added basic scaffolds for schools wrestlers and weights

This commit is contained in:
Jacob Cody Wimer
2013-12-31 11:23:43 -05:00
parent 5b6a127549
commit 24d9deee8b
57 changed files with 943 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
<%= form_for(@school) do |f| %>
<% if @school.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@school.errors.count, "error") %> prohibited this school from being saved:</h2>
<ul>
<% @school.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>
<div class="field">
<%= f.label :score %><br>
<%= f.number_field :score %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

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

View File

@@ -0,0 +1,29 @@
<h1>Listing schools</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Score</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @schools.each do |school| %>
<tr>
<td><%= school.name %></td>
<td><%= school.score %></td>
<td><%= link_to 'Show', school %></td>
<td><%= link_to 'Edit', edit_school_path(school) %></td>
<td><%= link_to 'Destroy', school, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New School', new_school_path %>

View File

@@ -0,0 +1,4 @@
json.array!(@schools) do |school|
json.extract! school, :id, :name, :score
json.url school_url(school, format: :json)
end

View File

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

View File

@@ -0,0 +1,14 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @school.name %>
</p>
<p>
<strong>Score:</strong>
<%= @school.score %>
</p>
<%= link_to 'Edit', edit_school_path(@school) %> |
<%= link_to 'Back', schools_path %>

View File

@@ -0,0 +1 @@
json.extract! @school, :id, :name, :score, :created_at, :updated_at