map.comatose_admin '/foo' messes up admin interface

0 views
Skip to first unread message

jux

unread,
Aug 30, 2008, 2:06:08 PM8/30/08
to Comatose Plugin
Hi,

I'm using Rails 2.1 and latest darthapo/comatose master from Github
(tree 03f8f6aefc7701f2d0edde63d711c33e7ec6857c).

To integrate comatose nicely with my app, I would like the comatose
admin interface to be accessible through the URL '/admin/pages'.
Following the documentation, I can achieve this through:

map.comatose_admin '/admin/pages' #in routes.rb

Using this, the comatose admin interface will correctly be shown at /
admin/pages, but all links will be to /comatose_admin/some_action/
some_id and not /admin/pages/some_action/id.

Looking through the comatose code, it seems this is no mistake on my
part, but rather a bug. To fix it, I guess the named route to the
admin path should be registered in Comatose.config and used for all
link_to's in the comatose admin view code. I am, however, not really
familar with the comatose code, so please let me know if there is a
better/easier solution.

- andreas

MRoderick

unread,
Aug 30, 2008, 4:37:28 PM8/30/08
to Comatose Plugin
I use map.comatose_admin 'admin/pages' in my routes, on 2.1

jux

unread,
Aug 31, 2008, 7:20:48 AM8/31/08
to Comatose Plugin
On Aug 30, 10:37 pm, MRoderick <roderick.mor...@gmail.com> wrote:
> I use map.comatose_admin 'admin/pages' in my routes, on 2.1

Alright, turns out it was my bad:

The default route

map.connect ':controller/:action/:id' # route.rb

was above

map.comatose_admin 'admin/pages' # route.rb

thus eg. link_to 'foo', { :action => 'new', :parent => parent }
matched the default route instead of the comatose_admin-route yielding
the link "/comatose_admin/new". I do consider it a rather brittle
solution, but now it works. :)

Cheers for a quick response.

- andreas
Reply all
Reply to author
Forward
0 new messages