在 controller 的 inquire 中定义如下语句
def inquire
start_date = Date.civil(params[:start_date][:year].to_i, params[:start_date][:month].to_i, params[:start_date][:day].to_i)
...
end
html 这样写的
<%= form_tag inquire_jobs_path, method: "get" do %>
<%= select_date Date.today, prefix: :start_date %>
<%= select_date Date.today, prefix: :end_date %>
<%= submit_tag("查询") %>
<% end %>
但出现如下错误
NoMethodError in JobsController#inquire
undefinded method '[]' for nil:NilClass