I am working with search forms and want to use GET request in a ruby on rails form . I use something like this
1) in view
form_tag(:action => "actionxyz", :method => "get")
2) In routes
get 'actionxyz', :controller => :controllerabc
When the request is inspected , the following is seen
<form accept-charset="UTF-8" action="/actionxyz?method=get" method="post"><div style="margin:0;padding:0;display:inline">
Further more in the url I see /actionxyz?method=get and not the search string that I have provided. The search string provided appears in the POST data.
Does that mean that rails is not using GET method or I am wrong in my interpretation.
Please clarify ..
It’s interpreting the method
getas part of the route the form should go to, instead of an additional options toform_tag. So, you must isolate it:or just