Hi, I have a best practice question: In my web apps you have to log in to show a certain Item, but you can show the item''s list without log in. Here are the steps: Items list page -> click on certain Item -> show "log in" page -> show Item''s page How can I do to store the "next_page" information ? whith flash[:next_page] I had some problem (because of reload current page) Any suggest ? thank you, Alessandro -- Posted via http://www.ruby-forum.com/.
If you''re using restful_authentication plugin, check out the method called redirect_back_or_default. Even otherwise, I think thats what you want. Its a simple short method, try getting your hands on it. On Aug 31, 7:09 pm, Ale Ds <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > I have a best practice question: > > In my web apps you have to log in to show a certain Item, but you can > show the item''s list without log in. > > Here are the steps: > Items list page -> click on certain Item -> show "log in" page -> show > Item''s page > > How can I do to store the "next_page" information ? > > whith flash[:next_page] I had some problem (because of reload current > page) > > Any suggest ? > > thank you, > Alessandro > -- > Posted viahttp://www.ruby-forum.com/.
Hi, You can store this information in the session, and then in your login action you should check if session[:next_page] is present, redirect user to that page; else to normal home page. -- Abhinav http://twitter.com/abhinav On Mon, Aug 31, 2009 at 7:39 PM, Ale Ds <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > Hi, > I have a best practice question: > > In my web apps you have to log in to show a certain Item, but you can > show the item''s list without log in. > > Here are the steps: > Items list page -> click on certain Item -> show "log in" page -> show > Item''s page > > How can I do to store the "next_page" information ? > > whith flash[:next_page] I had some problem (because of reload current > page) > > > Any suggest ? > > thank you, > Alessandro > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ram wrote:> If you''re using restful_authentication plugin, check out the method > called redirect_back_or_default. Even otherwise, I think thats what > you want. Its a simple short method, try getting your hands on it.Hi, I am using authlogic as authentication plugin, I don''t know if in authlogic there is some method similar to redirect_back_or_default (I have to check out. Anyone know it ?), if I didn''t find it, I will use "session[:next_page]" (as Abhinav suggested). thank you, Alessandro http://twitter.com/alexdesi -- Posted via http://www.ruby-forum.com/.