It's not form_tag
that's giving you the error, it's text_field
. text_field
is designed to be used inside form_for
, not form_tag
.
I think you mean to use text_field_tag
instead.
text_field(object_name, method, options = {})
Returns an input tag of the “text” type tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). Additional options on the input tag can be passed as a hash with options. These options will be tagged onto the HTML as an HTML element attribute as in the example shown.
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html
text_field_tag(name, value = nil, options = {})
Creates a standard text field; use these text fields to input smaller chunks of text like a username or a search query.
http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html