Routing and default module

I would like to route all requests with the path
“foo/:controller/:action” to a modulized controller like
‘bar/#{controller}’. So “foo/bro/index” goes to Bar::BroController,
“foo/baz/index” goes to Bar::BazController, etc.

I’m stumped as to how to write a one-line route for this. What I want to
do is something like

map.connect ‘foo/:controller/:action’, :controller =>
‘bar/#{controller}’

but that doesn’t pass muster.

Any ideas?

Thanks-

Danny

Nobody??

Why not just define it as /bar/ in the first place?

On Fri, Apr 4, 2008 at 3:51 PM, Danny B. <
[email protected]> wrote:

Nobody??

Posted via http://www.ruby-forum.com/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

Ryan B. wrote:

Why not just define it as /bar/ in the first place?

Because I want to use routing to map a URL semantic only my controller
structure. That’s what routing does. I just can’t figure out a DRY way
to do it in this instance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs