title: devise after_sign_in_path
body: <p>I create a location and user at the same time in a nested model form. I want the user to be taken to the location show page for the location id that was just created. How can I do this?</p>
  
  <p>I know that I can get to locations index by putting this into the applications controller</p>
  
  <pre><code>def after_sign_in_path_for(resource)
        locations_path # &lt;- Path you want to redirect the user to.
      end
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>def after_sign_in_path_for(resource)
        location_path(@location) # &lt;- Path you want to redirect the user to.
      end
  </code></pre>
  
  <p>but it gives a nil value for id. Any thoughts?</p>