look:
bingo bob wrote:
>
> 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"}}
params[:location][:id] is the way to get the location id
unless params[:location][:id].empty?
# location is set
else
# no location at all
end
>
> ---------
>
> 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.
--
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz
===============================================================================
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---