Ruby on Rails Sunday, October 3, 2010

Hello!

I have a systemwide search field with a submit button (submit_tag).
Like so:

<%= submit_tag "Search" %>

I wonder if there is a way to link to a chosen path when the user
presses the submit button, in my case to the root_path. Or should i
use something else instead of 'submit_tag'?

I have another question on a similar topic, in my search field I have
a default text value (:value => "Search on..."), is there an easy
Rails way to clear the default value when the user activates the
field, or should I use some Javascript?

Examples or links would greatly be appreciated.

Thanks

// Anders

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment