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 | |
parent | 1ec0bbad344790e7181a586cd24914c677d20d32 (diff) |
defaults now come in
-rw-r--r-- | app/assets/stylesheets/tournaments.css.scss | 9 | ||||
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 13 |
2 files changed, 19 insertions, 3 deletions
diff --git a/app/assets/stylesheets/tournaments.css.scss b/app/assets/stylesheets/tournaments.css.scss index e372b90..458897e 100644 --- a/app/assets/stylesheets/tournaments.css.scss +++ b/app/assets/stylesheets/tournaments.css.scss @@ -1,3 +1,12 @@ // Place all the styles related to the tournaments controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +p.default-field { + display: inline; +} + +span.default-explanation { + color: gray; + font-style: italic; +} 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 %> |