Question

I use date_select to create a dropdown menu with Rails 4.

date_select('range', 'start_date', { :order => [:day, :month, :year], :start_year => 2008, :end_year => Date.current.year, :use_month_numbers => true, :default => session[:start_date]}, {:method => :get, :onchange => "document.dsform.submit()"})

However, the data is sent with a POST request instead of GET. What is going wrong here?

Était-ce utile?

La solution

The method: get attribute should be defined on the form and not on the input tag.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top