mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-01 11:31:56 +00:00
Entered devise secret key
This commit is contained in:
33
app/views/tournaments/_form.html.erb
Normal file
33
app/views/tournaments/_form.html.erb
Normal file
@@ -0,0 +1,33 @@
|
||||
<%= form_for(@tournament) do |f| %>
|
||||
<% if @tournament.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @tournament.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 :address %><br>
|
||||
<%= f.text_field :address %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :director %><br>
|
||||
<%= f.text_field :director %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :director_email %><br>
|
||||
<%= f.text_field :director_email %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
6
app/views/tournaments/edit.html.erb
Normal file
6
app/views/tournaments/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing tournament</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @tournament %> |
|
||||
<%= link_to 'Back', tournaments_path %>
|
||||
33
app/views/tournaments/index.html.erb
Normal file
33
app/views/tournaments/index.html.erb
Normal file
@@ -0,0 +1,33 @@
|
||||
<h1>Listing tournaments</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>Director</th>
|
||||
<th>Director email</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @tournaments.each do |tournament| %>
|
||||
<tr>
|
||||
<td><%= tournament.name %></td>
|
||||
<td><%= tournament.address %></td>
|
||||
<td><%= tournament.director %></td>
|
||||
<td><%= tournament.director_email %></td>
|
||||
<td><%= link_to 'Show', tournament %></td>
|
||||
<td><%= link_to 'Edit', edit_tournament_path(tournament) %></td>
|
||||
<td><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Tournament', new_tournament_path %>
|
||||
4
app/views/tournaments/index.json.jbuilder
Normal file
4
app/views/tournaments/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@tournaments) do |tournament|
|
||||
json.extract! tournament, :id, :name, :address, :director, :director_email
|
||||
json.url tournament_url(tournament, format: :json)
|
||||
end
|
||||
5
app/views/tournaments/new.html.erb
Normal file
5
app/views/tournaments/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New tournament</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', tournaments_path %>
|
||||
59
app/views/tournaments/show.html.erb
Normal file
59
app/views/tournaments/show.html.erb
Normal file
@@ -0,0 +1,59 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_tournament_path(@tournament) %> |
|
||||
<%= link_to 'Back', tournaments_path %>
|
||||
|
||||
<h1>
|
||||
<%= @tournament.name %>
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<strong>Address:</strong>
|
||||
<%= @tournament.address %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Director:</strong>
|
||||
<%= @tournament.director %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Director email:</strong>
|
||||
<%= @tournament.director_email %>
|
||||
</p>
|
||||
<br>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}" %>
|
||||
<% end %>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Schools</h3>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Score</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @schools.each do |school| %>
|
||||
<tr>
|
||||
<td><%= school.name %></td>
|
||||
<td><%= school.score %></td>
|
||||
<td><%= link_to 'Show', school, :class=>"btn" %>
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to 'Edit', edit_school_path(school), :class=>"btn" %>
|
||||
<%= link_to 'Destroy', school, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
1
app/views/tournaments/show.json.jbuilder
Normal file
1
app/views/tournaments/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.extract! @tournament, :id, :name, :address, :director, :director_email, :created_at, :updated_at
|
||||
Reference in New Issue
Block a user