In a blog app I want every user to access a form to post a comment.
When the user submit the comment form he is redirected to the Devise sign_in form if is not logged in.
before_filter :authenticate_user!, :except => [:index, :show, :new]
How could I once the user sign_in, redirect him to the comment form and fill all fields ?
Thanks in advance
If you want to take the user to comment form after every sign in, add in ApplicationController:
If you want to take user back to the page they were at before sign in, you could save the current controller+action in session and redirect back:
And then :