blob: 20c7b3f28b9fb8c6fc4d57915294dd2b14aa368c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<%= form_for(@tournament) do |f| %>
<%= render "common/error_messages", :target => @tournament %>
<%= f.hidden_field(:game_id) %>
<%= fields_for "tournament[settings]", @tournament.settings do |setting_fields| %>
<% @tournament.game.settings.each do |setting| %>
<p>
<%= setting_fields.label setting.name %>
<br>
<% case setting.vartype %>
<% when 0 %>
<%= setting_fields.text_field( setting.name ) %>
<% when 1 %>
<%= setting_fields.text_area( setting.name ) %>
<% when 2 %>
<% setting.type_opt.split(',').each do |option|%>
<%= setting_fields.radio_button( setting.name, option ) %> <%= option %> <br>
<% end %>
<% when 3 %>
<% setting.type_opt.split(',').each do |option|%>
<%= check_box_tag(setting.name, value = option, checked = false, options = {}) %> <%= option %> <br>
<% end %>
<% when 4 %>
<%# setting_fields.label "true" %>
<%= setting_fields.radio_button( setting.name, "true" ) %> True
<%# setting_fields.label "false" %>
<%= setting_fields.radio_button( setting.name, "false" ) %> False
<% when 5 %>
<%= setting_fields.select( setting.name, setting.type_opt.split(',') ) %>
<% end %>
<% end %>
</p>
<% end %>
<%= f.submit %>
<% end %>
|