I have this in routes.rb:

map.connect 'pupils/*filters', :controller => "pupils", :action =>
":filter"

Given this url, for example:

http://localhost:3000/pupils/cohort_id/1/house_id/3

I would like to be able to grab an unlimited number of values to
filter pupils in the controller (so I don't have to write out all the
options in route.rb)


So far I have... (but clearly this isn't going to work)

def filter
@pupils = Pupil.find(:all, :conditions => params[:filters])
end

I found this with google but it complains about an odd number of
arguments:

@pupils = Pupil.find(:all, :conditions => Hash[params[:filters]])

Please help me with the controller find line, or tell me this isn't
the way to be doing this at all.

Thanks.

--
Matt



--~--~---------~--~----~------------~-------~--~----~
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