Devise alters app layout links

Hey everyone,
I’ve got a curious issue with Devise 1.2.1 on Rails 3.0.5. I’ve got
everything working quite nicely with one small problem: the navigation
links for my site that exist in the application controller get changed
when on the devise views. For example, a link that would be
localhost:3000/messages/inbox will turn into
localhost:3000/devise/message/inbox when using one of the devise views,
like users/edit and whatnot.

Has anyone experienced this problem? My link_to’s explicitly state the
destination controller and action, but I ain’t gettin any love here.

Thanks in advance!

  • Jeff

Phil

On Tue, Apr 12, 2011 at 4:00 PM, Jeff M. [email protected]
wrote:

destination controller and action, but I ain’t gettin any love here.

I’m guessing it’s assuming the controller & action you’re naming are
relative to the device namespace. If you just use the explicit name of
the
route (whatevers_path, etc), you won’t have that problem. rake routes | grep whatever will be your friend in this.

Thank you, sir - you’ve saved my bacon as well as my mind.

Another solution to this (which I needed, since I was using a non-
resourceful controller) is to prefix your controller name in the
link_to with a “/”, e.g. <%= link_to :controller => ‘/
about’, :action…