I’m moved some controllers to
app/admin/
and add this to the routes
map.connect ‘admin/:controller/:action/:id’
The controllers have the admin prefix :
class Admin::DoSomethingController < ApplicationController
…
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?
Rails 1.2.2
Gems 0.9.2
I'm moved some controllers to
app/admin/
and add this to the routes
map.connect 'admin/:controller/:action/:id'
The controllers have the admin prefix :
class Admin::DoSomethingController < ApplicationController
...
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
Philip Hallstrom said the following on 02/09/2007 06:02 PM:
I'm moved some controllers to
app/admin/
and add this to the routes
map.connect 'admin/:controller/:action/:id'
The controllers have the admin prefix :
class Admin::DoSomethingController < ApplicationController
...
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.
I'm having a similar-but-different problem.
I'm working on a wiki with webs (books in i2 parlance), so the normal url reads
http://sitename.com/Web/WikiWordTopic
(do I use ":requirements" to make sure?)
so the admin interface for doing things that the normal wiki user can't is
http://sitename.com/admin/web for the list
http://sitename.com/admin/web/Web for a specific web
http://sitename.com/admin/web/Web/WikiWordTopic for a specific topic
and drill down for its attributes.
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...
1. Philip could you post the line from your routes.rb, please, to clarify.
2. 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)