Say I have a comment section and when a user enters a comment, if the user is not logged in, I want to show the sign in form in a modal box. Once the user is logged in, it should proceed to post the comment. I tried the following but it is redirecting the sign up page instead. Any suggestions? Thanks!
CommentsController
def create
if !user_signed_in?
redirect_to(new_user_session_path, :remote=>true, :data => { :target => "#signin", :toggle => "modal"})
else
### continue with create
end
end