I have a requirement to support a query syntax on my resources like
so:

http://localhost:3000/people(last_name=jones).xml

I can hook that up so that the people controller receives that action
via map.connect like so:

 map.connect ':people_query_regexp',
             :controller => 'people',
             :index => 'index',
             :requirements => { :people_query_regexp => /people.*/ }

But people is a RESTful resource, so I want to do the same thing using
map.resources instead of map.connect. If I change the routing to:

 map.resources ':parties_query_regexp',
               :controller => 'parties',
               :requirements => { :parties_query_regexp => /
parties.*/ }

...then the server fails on startup like so:

lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/routing/
route_set.rb:141:in `define_hash_access': (eval):3:in
`define_hash_access': compile error
(SyntaxError) (eval):1: syntax error, unexpected ':', expecting '\n'
or ';'
             def hash_for_:people_query_regexp_index_pat...

It chokes on a syntax error because there's a colon in the middle of
the method name it's trying to define.

So is there a way around this? What am I doing wrong? This is Rails
2.2.2, btw.

Thanks.
--mark

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