Hi! I have a problem. I create a search in will_paginate like Ryan Bates tutorial: http://railscasts.com/episodes/51-will-paginate but with light modification of code:> <% form_tag clients_path, :method => ''get'' do %>> <%= select_tag :gender, options_for_select([[''Select'',nil],[''Male'', > true],[''Female'', false]]) %>> <%= submit_tag "Search", :name => nil %> > <% end %>When I select "Male"(for example) click "Search" button, I find what I need, but! the option in select_tag is "Select". How I can do that''s option at my select_tag after select "Male" and click submit_button will be "Male"? Cheers, Michael -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You need to get the current value from the params hash. Something like this: <%= select_tag :gender, options_from_collection_for_select(@genders, "value", "name", params[:gender]), :include_blank => true %> Notice the params[:gender]. Regards Linus -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Be_z3ZrTtEIJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.