http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001038
The second argument is the value you want it to be ... so, default
params[:query] in your controller, or do something like this
<%=text_field_tag("query", params[:query] || "Some
value", :autocomplete => "off" ) %>
in-line || allows you to specify something if the value before the ||
is nil, another useful thing, e.g. in the controller
params[:query] ||= "Some value"
This will set the value if params[:query] is nil
HTH
Eamo2 Dsf wrote:> Simple problem but I can''t find a solution.
>
> I have this tag:
>
> <%=text_field_tag("query", params[:query], :autocomplete =>
"off" ) %>
>
> Its a search field box.
>
> Question: how do I update the text in the text field???? i.e is there a
> rails equivalent like query.setText("some text")
>
> Thanks
> --
> Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---