自动提交表单
<% form_tag "/tasks",:method => :get do %>
<%= select_tag 'project_id', options_for_select(Project.for_select(current_user),params[:project_id].to_i), :onchange => 'this.form.submit()' %>
<%= text_field_tag :search_content %>
<%= submit_tag "搜索" %>
<% end %>
重要的第二行的:onchange => 调用
顺便记录一下:options_for_select()