Dear all, How can I get lastly accessed url on my current page. i.e. user is on ''Posts'' page & now if user wants to add new post for that user needs to login first... for that user ''ll be redirected to login page...Now after getting logged in successfully user must be redirected to the ''Posts'' page again so that now he can add new post.. Thanking you... -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Mar 26, 2010 at 2:17 PM, Rutvij Pandya <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Dear all, > > How can I get lastly accessed url on my current page. > i.e. user is on ''Posts'' page & now if user wants to add new post for > that user needs to login first... for that user ''ll be redirected to > login page...Now after getting logged in successfully user must be > redirected to the ''Posts'' page again so that now he can add new post.. >In a controller you can do request.url -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rick Denatale wrote:> On Fri, Mar 26, 2010 at 2:17 PM, Rutvij Pandya <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: >> �How can I get lastly accessed url on my current page. >> �i.e. user is on ''Posts'' page & now if user wants to add new post for >> that user needs to login first... for that user ''ll be redirected to >> login page...Now after getting logged in successfully user must be >> redirected to the ''Posts'' page again so that now he can add new post.. >> > In a controller you can do request.urlYou should also seriously consider using one of the authentication gems that are available. They already solve this issue and many more. No need to roll your own authentication system with all the options available. I see that a lot of people seem to like AuthLogic, there is also Devise, and several others. http://github.com/binarylogic/authlogic http://github.com/plataformatec/devise -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.