mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Removed weight mat association
This commit is contained in:
@@ -21,7 +21,6 @@ class WeightsController < ApplicationController
|
||||
@tournament_field = params[:tournament]
|
||||
@tournament = Tournament.find(params[:tournament])
|
||||
end
|
||||
@mats = Mat.where(tournament_id: @tournament.id)
|
||||
end
|
||||
|
||||
# GET /weights/1/edit
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
class Mat < ActiveRecord::Base
|
||||
belongs_to :tournament
|
||||
has_many :weights, dependent: :destroy
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
|
||||
<br>
|
||||
<br>
|
||||
<h1><%= @weight.max %> lbs Bracket <%= Mat.find(@weight.mat_id).name %></h1>
|
||||
<h1><%= @weight.max %> lbs Bracket</h1>
|
||||
<% if @bracket_size == 10 %>
|
||||
<%= render 'man10' %>
|
||||
<% elsif @bracket_size == 9 %>
|
||||
|
||||
@@ -24,13 +24,6 @@
|
||||
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label 'Assigned Mat' %><br>
|
||||
<%= f.collection_select :mat_id, @mats, :id, :name %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
|
||||
5
db/migrate/20140130153634_drop_weight_mat_id.rb
Normal file
5
db/migrate/20140130153634_drop_weight_mat_id.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class DropWeightMatId < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :weights, :mat_id
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20140125072649) do
|
||||
ActiveRecord::Schema.define(version: 20140130153634) do
|
||||
|
||||
create_table "matches", force: true do |t|
|
||||
t.integer "r_id"
|
||||
@@ -75,7 +75,6 @@ ActiveRecord::Schema.define(version: 20140125072649) do
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "tournament_id"
|
||||
t.integer "mat_id"
|
||||
end
|
||||
|
||||
create_table "wrestlers", force: true do |t|
|
||||
|
||||
Reference in New Issue
Block a user