mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
The rest of 1-21 changes. Mostly visual flow between tournament school and wrestlers
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
/*
|
|
||||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
||||||
* listed below.
|
|
||||||
*
|
|
||||||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
||||||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
|
||||||
*
|
|
||||||
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
|
||||||
* compiled file, but it's generally better to create a new file per style scope.
|
|
||||||
*
|
|
||||||
*= require_self
|
|
||||||
*= require_tree .
|
|
||||||
*/
|
|
||||||
@@ -16,6 +16,9 @@ class SchoolsController < ApplicationController
|
|||||||
# GET /schools/new
|
# GET /schools/new
|
||||||
def new
|
def new
|
||||||
@school = School.new
|
@school = School.new
|
||||||
|
if params[:tournament]
|
||||||
|
@tournament = params[:tournament]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /schools/1/edit
|
# GET /schools/1/edit
|
||||||
@@ -70,6 +73,6 @@ class SchoolsController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def school_params
|
def school_params
|
||||||
params.require(:school).permit(:name, :score)
|
params.require(:school).permit(:name, :score, :tournament_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class StaticPagesController < ApplicationController
|
class StaticPagesController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@tournaments = Tournament.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def school
|
def school
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
class School < ActiveRecord::Base
|
class School < ActiveRecord::Base
|
||||||
|
belongs_to :tournament
|
||||||
has_many :wrestlers
|
has_many :wrestlers
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,9 +10,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<%= render 'layouts/header' %>
|
<%= render 'layouts/header' %>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<% flash.each do |key, value| %>
|
|
||||||
<div class="alert alert-<%= key %>"><%= value %></div>
|
|
||||||
<% end %>
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<%= render 'layouts/footer' %>
|
<%= render 'layouts/footer' %>
|
||||||
<%= debug(params) if Rails.env.development? %>
|
<%= debug(params) if Rails.env.development? %>
|
||||||
|
|||||||
@@ -19,6 +19,19 @@
|
|||||||
<%= f.label :score %><br>
|
<%= f.label :score %><br>
|
||||||
<%= f.number_field :score %>
|
<%= f.number_field :score %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<% if @school %>
|
||||||
|
<%= f.hidden_field :tournament_id, :value => @tournament %>
|
||||||
|
<% else %>
|
||||||
|
<div class="field">
|
||||||
|
<%= f.label 'Tournament' %><br>
|
||||||
|
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit %>
|
<%= f.submit %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
<%= @school.score %>
|
<%= @school.score %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Tournament:</strong>
|
||||||
|
<%= Tournament.find(@school.tournament_id).name %>
|
||||||
|
</p>
|
||||||
|
|
||||||
<%= link_to "Edit #{@school.name}", edit_school_path(@school) %> |
|
<%= link_to "Edit #{@school.name}", edit_school_path(@school) %> |
|
||||||
<%= link_to 'Back to Schools', schools_path %> |
|
<%= link_to 'Back to Schools', schools_path %> |
|
||||||
<%= link_to 'Back to Admin', '/admin/index' %>
|
<%= link_to 'Back to Admin', '/admin/index' %>
|
||||||
|
|||||||
@@ -1,7 +1,25 @@
|
|||||||
<h1>CCHS Wrestling</h1>
|
<h1>Pick A Tournament</h1>
|
||||||
<h3>1st Annual Comet Classic</h3>
|
<%= link_to 'New Tournament', new_tournament_path, :class=>"btn" %>
|
||||||
<p>Central Crossing High School</p>
|
</br>
|
||||||
<p>4500 Big Run South Rd, Grove City, OH</p>
|
</br>
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% @tournaments.each do |tournament| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= tournament.name %></td>
|
||||||
|
<td><%= link_to 'Show', tournament, :class=>"btn" %><%= link_to 'Edit', edit_tournament_path(tournament), :class=>"btn" %><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
|
||||||
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Central+Crossing+High+School,+Big+Run+South+Road,+Grove+City,+OH&aq=0&oq=central+crossing&sll=40.365277,-82.669252&sspn=4.888292,10.821533&t=h&ie=UTF8&hq=Central+Crossing+High+School,+Big+Run+South+Road,+Grove+City,+OH&ll=39.89637,-83.113117&spn=0.019228,0.042272&z=14&iwloc=A&cid=10210402163347601240&output=embed"></iframe><br /><small><a href="https://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=Central+Crossing+High+School,+Big+Run+South+Road,+Grove+City,+OH&aq=0&oq=central+crossing&sll=40.365277,-82.669252&sspn=4.888292,10.821533&t=h&ie=UTF8&hq=Central+Crossing+High+School,+Big+Run+South+Road,+Grove+City,+OH&ll=39.89637,-83.113117&spn=0.019228,0.042272&z=14&iwloc=A&cid=10210402163347601240" style="color:#0000FF;text-align:left">View Larger Map</a></small>
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Wrestling::Application.routes.draw do
|
Wrestling::Application.routes.draw do
|
||||||
|
resources :tournaments
|
||||||
|
|
||||||
resources :schools
|
resources :schools
|
||||||
|
|
||||||
resources :weights
|
resources :weights
|
||||||
|
|||||||
12
db/schema.rb
12
db/schema.rb
@@ -11,13 +11,23 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20131231135039) do
|
ActiveRecord::Schema.define(version: 20140121020833) do
|
||||||
|
|
||||||
create_table "schools", force: true do |t|
|
create_table "schools", force: true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.integer "score"
|
t.integer "score"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.integer "tournament_id"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "tournaments", force: true do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.string "address"
|
||||||
|
t.string "director"
|
||||||
|
t.string "director_email"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "weights", force: true do |t|
|
create_table "weights", force: true do |t|
|
||||||
|
|||||||
Reference in New Issue
Block a user