title: Ruby on Rails - Devise Error: undefined local variable or method
body: <p>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 <code>after_sign_in_path_for</code> helper from Devise.  I have looked at the documentation on this helper <a href="http://rubydoc.info/github/plataformatec/devise/master/Devise/Controllers/Helpers:after_sign_in_path_for" rel="nofollow noreferrer">here</a>.</p>
  <p>But I am getting the following error upon submitting the sign in credentials:</p>
  <pre><code>NameError (undefined local variable or method `dashboard_url' for #
  &lt;Devise::SessionsController:0x007fcc36079d88&gt;):
  app/controllers/application_controller.rb:27:in `after_sign_in_path_for'
  </code></pre>
  <p>Here's what I'm working with:</p>
  <h1>config/routes.rb</h1>
  <pre><code>My::Application.routes.draw do
    get &quot;login/index&quot;
    devise_for :users, path_names: {sign_in: &quot;login&quot;} do
      get '/users/sign_out' =&gt; 'devise/sessions#destroy'
    end
   get &quot;dashboard/index&quot;
   root :to =&gt; &quot;login#index&quot;
   get 'dashboard' =&gt; 'dashboard#index', as: :dashboard_url
   get ':controller(/:action(/:id(.:format)))'
  end
  </code></pre>
  <p>The path shows up in <code>rake routes</code> as the following:</p>
  <h1>rake routes</h1>
  <pre><code>  dashboard_url GET    /dashboard(.:format)                   dashboard#index
  </code></pre>
  <p>Any help would be appreciated!  Thank you.</p>