我有这样的表格:
<%= form_tag project_configure_select_path , :method => :put do %>
Select The Type Of Project<%= select_tag "type", "<option>Agile</option><option>Sales</option>".html_safe %>
<br/>
<label class="agile">
<%= check_box_tag 'modules_enabled[]', "time_tracking", false, :id => "project_enabled_module_names_time_tracking", :checked => "checked", :type => "hidden" %>
<%= check_box_tag 'modules_enabled[]', "issue_tracking", false, :id => "project_enabled_module_names_issue_tracking", :checked => "checked", :type => "hidden" %>
<%= check_box_tag 'modules_enabled[]', "wiki", false, :id => "project_enabled_module_names_wiki", :checked => "checked", :type => "hidden" %>
<br/>
</label>
<label class="sales"> <%= check_box_tag 'modules_enabled[]', "news", false, :id => "project_enabled_module_names_news", :checked => "checked", :type => "hidden" %> </label>
<br/>
<%= submit_tag 'Submit'%>
<% end %>
我想在这里提出一个条件。那就是如果我从选择标签中选择选项敏捷,那么标签 class="agile" 必须工作,否则如果它是销售,那么它下面的另一个标签块称为 class = "sales" 必须工作。
我没有将这些中的任何一个存储在数据库中。所以我希望根据我的选择来选择特定的块。
非常感谢