diff options
author | Tomer Kimia <tkimia@purdue.edu> | 2014-03-06 19:12:48 -0500 |
---|---|---|
committer | Tomer Kimia <tkimia@purdue.edu> | 2014-03-06 19:12:48 -0500 |
commit | 8e1ca0e4f9107a43fbdf0dac315e3467b0158356 (patch) | |
tree | 6d342386e0bc072d6c5729d4ee8fc962d74f4b11 /app/views/tournaments | |
parent | 1ec0bbad344790e7181a586cd24914c677d20d32 (diff) |
defaults now come in
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index cfa91fa..9b1b7f8 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -2,14 +2,21 @@ <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> + <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> <% next %> <% end %> <p> <%= f.label name %><br> - <%= f.text_field name %> + <% if !@chosen.attributes[name].nil? %> + <%= f.text_field(name, :value => @chosen.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> + </p> + <% end %> <%= f.submit %> -<% end %>
\ No newline at end of file +<% end %> |