I''m working on my spin of the age old shopping cart app. To help
customers focus on checking out it seems reasonable enough to give
them a simpler layout while they''re doing so. I added the following
code to my app. You can assume that @mysession.checking_out? is
functioning correctly and returns either true or false depending on
the users state at present. It is well tested.
So in development this works like a charm, no problems. Once I move
it into production, the layout used is correctly selected the first
hit, but all subsequent hits to that particular controller/action
combination use that same layout regardless of state.
Production environment settings have not been altered, I''m not using
any form of caching.
If you have any idea what is going on I''d appreciate your insight.
Here''s the Code:-----------------
class ApplicationController < ActionController::Base
...
before_filter :checkout?
...
def checkout?
#if we are checking out and this isn''t a checkout activity but it
is a get request, then...
...
if @mysession.checking_out?
self.class.layout "checkout"
end
...
end
--------------
Thanks,
Aaron
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
> I''m working on my spin of the age old shopping cart app. To help > customers focus on checking out it seems reasonable enough to give > them a simpler layout while they''re doing so. I added the following > code to my app. You can assume that @mysession.checking_out? is > functioning correctly and returns either true or false depending on > the users state at present. It is well tested. > > So in development this works like a charm, no problems. Once I move > it into production, the layout used is correctly selected the first > hit, but all subsequent hits to that particular controller/action > combination use that same layout regardless of state. > > Production environment settings have not been altered, I''m not using > any form of caching. > > If you have any idea what is going on I''d appreciate your insight. > > Here''s the Code:----------------- > class ApplicationController < ActionController::Base > ... > before_filter :checkout? > ... > def checkout? > #if we are checking out and this isn''t a checkout activity but it > is a get request, then... > ... > if @mysession.checking_out? > self.class.layout "checkout"else self.class.layout "the normal one" end Rails saves the layout you define at the class level when it first reads/loads that class. So once you switch it, it''s never switching back. -philip> end > ... > end > -------------- > > Thanks, > Aaron > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Also - production env have cache set on default. On Jul 5, 2:17 pm, Aaron <sto...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m working on my spin of the age old shopping cart app. To help > customers focus on checking out it seems reasonable enough to give > them a simpler layout while they''re doing so. I added the following > code to my app. You can assume that @mysession.checking_out? is > functioning correctly and returns either true or false depending on > the users state at present. It is well tested. > > So in development this works like a charm, no problems. Once I move > it into production, the layout used is correctly selected the first > hit, but all subsequent hits to that particular controller/action > combination use that same layout regardless of state. > > Production environment settings have not been altered, I''m not using > any form of caching. > > If you have any idea what is going on I''d appreciate your insight. > > Here''s the Code:----------------- > class ApplicationController < ActionController::Base > ... > before_filter :checkout? > ... > def checkout? > #if we are checking out and this isn''t a checkout activity but it > is a get request, then... > ... > if @mysession.checking_out? > self.class.layout "checkout" > end > ... > end > -------------- > > Thanks, > Aaron--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---