Forum: Ruby on Rails must write ':controller => "/foo"' because of "admin/bar"

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B45eab4f18aa1bb2a44d6e657531a642?d=identicon&s=25 Alain Ravet (aravet)
on 2006-01-03 16:39
Hi all,

Because I place admin controllers in an "admin" subdirectory, I'm forced
to use absolute controller names/paths whole over my app.

I can no longer write:

    .. :controller => "foo"
    .. :controller => :foo

    .. :controller => "admin/bar

I have to use instead :

    .. :controller => "/foo"
    .. :controller => "/admin/bar

Is there a way around this?
I miss the symbol notation, and it's error prone (that's what my
fingers' keep telling me).

B45eab4f18aa1bb2a44d6e657531a642?d=identicon&s=25 Alain Ravet (aravet)
on 2006-01-04 00:35
Btw,  "assert_redirected_to" doesn't work with/recognize the absolute

The action:
     jumpto =  {:action => "home", :controller => "/cga"}
     redirect_to (jumpto)

requires you write the test this way
    assert_redirected_to :controller => "cga", :action => "index"

while the coherent/correct way would be :
    assert_redirected_to :controller => "/cga", :action => "index"

This topic is locked and can not be replied to.