form...

<% form_tag do %>

  <%= select("location", "id", Location.all.collect {|l| [ l.name, l.id 
]}, {:prompt => 'Any Location'}) %>
  <%= submit_tag "go" %>

<% end -%>

With any location selected...I click go.

params

{"commit"=>"go", 
"authenticity_token"=>"nhPdYCMi1hx7joug0JECpiEqQFQWDfbh/z56Go5PTEE=", 
"action"=>"index", "controller"=>"welcome", "location"=>{"id"=>""}}

with a location selected...i click go.

params

{"commit"=>"go", 
"authenticity_token"=>"nhPdYCMi1hx7joug0JECpiEqQFQWDfbh/z56Go5PTEE=", 
"action"=>"index", "controller"=>"welcome", "location"=>{"id"=>"3"}}


---------

so that looks like its ok at least location ID is getting set.

------

i am unsure what my controller should look like

I want to find all teachers if nothing is selected (default) and only 
find the teachers for the location selected when that is the case. When 
the filter is done the user should see the item they selected as well as 
the filtered list.
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to