Reputation: 3501
I am trying to use the form helper to build a form. I am trying to tell it what action to go to, but it keep redirecting to the create action
\<%= form_tag(controller: 'report', action: 'jira') do %>
Any thoughts on what could be causing this. The \ in the code above is just there so I could get code indenting.
Upvotes: 0
Views: 44
Reputation: 44360
From documentation FormTagHelper#form_tag
:
form_tag(url_for_options = {}, options = {}, &block)
Starts a form tag that points the action to an url configured with url_for_options just like ActionController::Base#url_for. The method for the form defaults to POST.
You should add method: :get
to you form. Form always redirecting to the create action, because method POST
.
try this form_tag({controller: 'report', action: 'jira'}, method: :get)
Upvotes: 1