diff options
author | DavisLWebb <davislwebb@ymail.com> | 2014-04-23 20:22:11 -0400 |
---|---|---|
committer | DavisLWebb <davislwebb@ymail.com> | 2014-04-23 20:22:11 -0400 |
commit | 8423f93a586c4278ea25d3b10bb731e732be0ba9 (patch) | |
tree | 047dfbfadeaef781a3a9242e571e253467c9a849 /app/views | |
parent | c5e0aeb5a055797fe4f26fb9e6f9e163d5d7f718 (diff) | |
parent | ae97abc3f47a7209ef8367a5781ca72ada90ddec (diff) |
Merge branch 'master' of https://github.com/LukeShu/Leaguer
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 9 | ||||
-rw-r--r-- | app/views/tournaments/new.html.erb | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 4efd17a..9240c49 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -2,18 +2,17 @@ <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> - <% @game = Game.find(params[:game]) %> <% @tournament.attributes.each do |name, value| %> <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") or (name == "set_rounds") %> <% next %> <% end %> <p> <%= f.label name %><br> - <% unless @game.attributes[name].nil? %> + <% unless @tournament.game.attributes[name].nil? %> <% if name == "sampling_method" %> - <%= f.select( name, @game.sampling_method.split(',') ) %> + <%= f.select( name, @tournament.game.sampling_method.split(',') ) %> <% else %> - <%= f.text_field(name, :value => @game.attributes[name] ) %> + <%= f.text_field(name, :value => @tournament.game.attributes[name] ) %> <% end %> <% else %> <%= f.text_field name %> @@ -22,7 +21,7 @@ <% end %> <%= fields_for "tournament[settings]", @tournament.settings do |setting_fields| %> - <% @game.settings.each do |setting| %> + <% @tournament.game.settings.each do |setting| %> <p> <%= setting_fields.label setting.name %> <br> diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 8c74068..66149fe 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -1,7 +1,7 @@ <h1>New Tournament</h1> <%= form_tag(new_tournament_path, method: "get") do %> - <%= select_tag('game', + <%= select_tag('tournament[game_id]', options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), :prompt => "Select a Game Type") %> <%= submit_tag("Select", :class => "btn btn-success btn-xs") %> |