Hey guys, I have a site using LoginGenerator and everything is working great. My site has certain actions that force logging in and certain actions that don''t. A user can log in at any time, regardless if his/her actions require authentication. For the ones that require login, the before_filter works great and store_location automatically redirects the user to the page requested. My question is, is there any way to return a user back to his/her original location if they chose to log in clicking the "Log in" button as opposed to actually being forced to log in. My first intuition was to add store_location to everything, but that doesn''t really sound like DRY. Any help? Thanks, Jin _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Jamie Macey
2005-Oct-27 18:56 UTC
Re: LoginGenerator - calling store_location for every page
On Thu, 2005-27-10 at 09:19 -0700, Jin Lee wrote:> Hey guys, > > I have a site using LoginGenerator and everything is working great. My > site has certain actions that force logging in and certain actions > that don''t. A user can log in at any time, regardless if his/her > actions require authentication. For the ones that require login, the > before_filter works great and store_location automatically redirects > the user to the page requested. > > My question is, is there any way to return a user back to his/her > original location if they chose to log in clicking the "Log in" button > as opposed to actually being forced to log in. My first intuition was > to add store_location to everything, but that doesn''t really sound > like DRY. > > Any help? > > Thanks, > JinDunno if this helps, but if you put store_location as a before filter in your ApplicationController, you get DRY and still have it everywhere. - Jamie