我要做选择查询功能,怎么把 select 标签里面的选择的 pc 或者 user 的值传到 :ABC 里呢?
View 页面
<%= form_tag "computers/select_db" do %>
<%= select_tag :ABC, "<option>pc</option><option>user</option><option>3</option><option>4</option>".html_safe %>
<%= text_field_tag [:select_c] %>
<%= submit_tag (value = "查询") %>
<% end %>
Controller/computers
def select_db
if
@computer = Computer.where(:ABC => params[:select_c])
render :action => "select_show"
end
end