Ruby On Rails - Devise Redirect Back To The Original Location After Sign In Or Sign Up? - Stack Overflow

Ruby On Rails - Devise Redirect Back To The Original Location After Sign In Or Sign Up? - Stack Overflow. Back them up with references or personal experience. But the browser (firefox) gave me this error :


You will probably have to store the original path in a session or something before logging them in. I want devise to redirect to my town controller at index action, upon sign up or login (login actually works). Provide details and share your research! I've tried overriding registrationscontroller and i've tried adding an applicationscontroller function like : It checks if user is logged in, if not it redirects the user to login page. Not sure what else to. Please be sure to answer the question. Def after_sign_in_path_for(resource_or_scope) session.fetch 'user_return_to', user_path end you can make it a bit more magic when you're working with multiple scopes. If someone want to open page without login then it redirect to sign_in page and after signed in it back to the page which user try to open. Do you redirect the user back to the previous page?

I have a devise app acting up. In rails 5 the mechanism was changed from simple redirect_to :back to dedicated function: Private def after_sign_out_path_for(resource) stored_location_for(resource) || request.referrer || root_path end I made a view under /app/views/devise/registrations called after_signup.html.erb. I'm having trouble with a small rsvp functionality. But the browser (firefox) gave me this error : Actually i am a newbie to rails. I am aware of these guides: But sign out is still returning to root. Please be sure to answer the question. Def after_sign_in_path_for(resource) params[:next] || super end