I have been checking on SO and the googles for a solution, but I can't figure out what I am doing wrong. I am trying to use the after_sign_in_path_for helper from Devise. I have looked at the documentation on this helper here.
But I am getting the following error upon submitting the sign in credentials:
NameError (undefined local variable or method `dashboard_url' for #
<Devise::SessionsController:0x007fcc36079d88>):
app/controllers/application_controller.rb:27:in `after_sign_in_path_for'
Here's what I'm working with:
config/routes.rb
My::Application.routes.draw do
get "login/index"
devise_for :users, path_names: {sign_in: "login"} do
get '/users/sign_out' => 'devise/sessions#destroy'
end
get "dashboard/index"
root :to => "login#index"
get 'dashboard' => 'dashboard#index', as: :dashboard_url
get ':controller(/:action(/:id(.:format)))'
end
The path shows up in rake routes as the following:
rake routes
dashboard_url GET /dashboard(.:format) dashboard#index
Any help would be appreciated! Thank you.