0
在選擇標籤紅寶石選項我有一個表格是這樣的:如何使用在軌道上
<%= 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 %>
我想在這裏提出一個條件。這就是說,如果我從select標籤中選擇Agile選項,那麼標籤類=「agile」必須工作,否則,如果是銷售額,那麼稱爲class =「sales」的另一個標籤塊必須工作。
我沒有在數據庫中存儲這些數據。所以我想要根據我的選擇來選擇特定的塊。
非常感謝
你應該嘗試在客戶端使用JavaScript來做這個 –