From 8e1ca0e4f9107a43fbdf0dac315e3467b0158356 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 6 Mar 2014 19:12:48 -0500 Subject: defaults now come in --- app/assets/stylesheets/tournaments.css.scss | 9 +++++++++ app/views/tournaments/_selected.html.erb | 13 ++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'app') 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 %>

<%= f.label name %>
- <%= f.text_field name %> + <% if !@chosen.attributes[name].nil? %> + <%= f.text_field(name, :value => @chosen.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> +

+ <% end %> <%= f.submit %> -<% end %> \ No newline at end of file +<% end %> -- cgit v1.2.3