After the first time accessing the url the ‘admin’ dir is added again. The
result url looks like this:
http://…/admin/admin/do_something/edit/1
How can this be fixed?? Ideas , anyone?
Why not just remove that route? I do the same thing as you but don’t
have
that route… just a single route to map “/admin” to the default
controller in my admin area.
After the first time accessing the url the ‘admin’ dir is added again. The
result url looks like this:
http://…/admin/admin/do_something/edit/1
How can this be fixed?? Ideas , anyone?
Why not just remove that route? I do the same thing as you but don’t
have
that route… just a single route to map “/admin” to the default
controller in my admin area.
-philip
This is correct.
When you move controller into a subfolder like that, the new “url name”
of that controller is “admin/do_stuff”. With the route
“admin/:controller”, the url name of the controller “admin/do_stuff”
gets inserted into :controller, producing “admin/admin/do_stuff”.
So get rid of that admin route and lets ActionController do its thang.
Yes, I still have things to sort out like what the urls are for
the user to login and return to the access controlled topic (or is that
done
via cookies), edit a topic … and of course what all that looks like in
the
mappings…
Philip could you post the line from your routes.rb, please, to
clarify.
If you move the controllers to app/controllers/admin do you have to
add
the
Admin:: prefix?
Or, to ask it all another way, is there a different way to
compartmentalise
both the code and the URL?
(such as …/do_something/1?admin perhaps)
–
If the box says ``Windows 95 or better’', it should run on Linux, right?
(Seen on Usenet)
Yes, I still have things to sort out like what the urls are for
the user to login and return to the access controlled topic (or is that
done
via cookies), edit a topic … and of course what all that looks like in
the
mappings…
Philip could you post the line from your routes.rb, please, to
clarify.
If you move the controllers to app/controllers/admin do you have to
add
the
Admin:: prefix?
Or, to ask it all another way, is there a different way to
compartmentalise
both the code and the URL?
(such as …/do_something/1?admin perhaps)
–
If the box says ``Windows 95 or better’', it should run on Linux, right?
(Seen on Usenet)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.