Closed colleeno closed 7 years ago
Hi Colleen, instead of using
redirect_to :back
couldn't you use
redirect_to category_script_path(@category, @script)
tried that, still directs to the route after login even with 'redirect_to category_script_path(@category, @script)'
¯_(ツ)_/¯
not a major issue, just a bit of an odd user experience
Try getting rid of the code you added to ApplicationController
as well. That is odd though, because typically devise will send you back to where you were going beforehand when it forces you to sign in.
I require uses to sign in to add a star to favorite a post ('script' in my project). Adding a star is defined on the script controller. Users are being dropped on the route page after sign in, I'd like to redirect users back to the script show page (nested under category) instead.
I tried a redirect back to my script show route, but still drops me on the root.
I added this code to my application controller, which is storing and directing a user back to something like 'http://localhost:3000/categories/tv/quotes/323/add_star' but I don't have an actual route ending in /add_star since it's just an action on my script page. Is there a way to just drop them on 'http://localhost:3000/categories/tv/quotes/323'?