开发者

Devise route not respected on Devise view pages

开发者 https://www.devze.com 2023-04-05 05:09 出处:网络
I have implemented de开发者_如何学Cvise and set up the routes to prettyify the urls as so (in the routes file):

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

精彩评论

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