Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How to Pass a Selected Option Value of select_tag from One Partial to Another
1 Post
How to Pass a Selected Option Value of select_tag from One Partial to Another

Hi,

I'm running Rails 2.3.5 & Ruby 1.8.7 on Windows XP.

I have two partials: 1. File app\views\warehousing_index.html.erb has

 .....

'name'), :name, :name)) %>

 .....
  'warehousing/entry', :locals =>

{:filter_by_category => "Hello World"} %>

 .....
  1. File app\views\warehousing_entry.html.erb has .....
    Selected category is
    .....

On the displayed page, it shows:

 Selected category is Hello World

That means the string "Hello World" in variable filter_by_category is indeed passed from one partial to the other. For my project, I want to pass the selected option value from the select_tag to partial entry.html.erb, i.e. in file entry.html.erb, for line

'warehousing/entry', :locals =>

{:filter_by_category => ???} %>

what should I put in for "???".

Thanks for any help that you could offer. Hoca

1 Post
Login to add your message