From 16750bab527d574867a64e3092f7335a028195cb Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 20 Apr 2014 00:04:55 -0400 Subject: Made settings work for all the different types, CSS needs to be updated. --- app/views/tournaments/_selected.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index d37c741..8bb0532 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -19,15 +19,18 @@ <%= fields_for "tournament[preferences]", @tournament.preferences do |setting_fields| %> <% @game.settings.each do |setting| %> +

+ <%= setting_fields.label setting.name %> +
<% case setting.stype %> <% when 0 %> - <%= setting_fields.text_field( setting.name, :name ) %> + <%= setting_fields.text_field( setting.name ) %> <% when 1 %> - <%= setting_fields.text_area( setting.name, setting.name ) %> + <%= setting_fields.text_area( setting.name ) %> <% when 2 %> - <%= setting_fields.collection_radio_buttons( setting.name, setting.type_opt.split(',') ) %> + <%= setting_fields.collection_radio_buttons( setting.name, setting.type_opt.split(','), :first, :last, { item_wrapper_tag: false } ) %> <% when 3 %> - <%= setting_fields.collection_check_boxes( setting.name, setting.type_opt.split(',') ) %> + <%= setting_fields.collection_check_boxes( setting.name, setting.type_opt.split(','), :first, :last, { item_wrapper_tag: false } ) %> <% when 4 %> <%= setting_fields.radio_button( setting.name, "true" ) %> <%= setting_fields.radio_button( setting.name, "false" ) %> @@ -35,6 +38,7 @@ <%= setting_fields.select( setting.name, setting.type_opt.split(',') ) %> <% end %> <% end %> +

<% end %> <%= f.submit %> <% end %> -- cgit v1.2.3-2-g168b