Next page after log in

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

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,

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs