开发者

Devise route not respected on Devise view pages

I have implemented de开发者_如何学Cvise and set up the routes to prettyify the urls as so (in the routes file):

devise_scope :user do
    get "/login" => "devise/sessions#new"
    get "/logout" => "devise/sessions#destroy"
    get "/register" => "devise/registrations#new"
end

I have global menu in my application.html.erb file, however, which now inserts devise/controller/action on every link that is on the login or register pages, such as

<%= link_to "Upload Video", {:controller => "videos", :action => "new"} %>

becomes devise/videos/new

Any ideas on how to fix this? I can hack around it but I'm pretty sure it is a simple fix.

Cheers,

s


Take out the devise_scope and try something like this:

  devise_for  :users, 
              :controllers => {:registrations => 'devise/registrations', :sessions => 'devise/sessions'}, 
              :path => '/',
              :path_names => {:sign_in => 'login', :sign_out => 'logout'}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜