Okay, someone smarter than me needs to add this to the Rails framework. It would be great if whenever a new session_id is created, the request object gets a "new_session?" attribute. This is kind-of like the ActiveRecord object and the "new_record?" attribute. I know this could be accomplished by creating session variables, but I still think this is a more elegant solution. I just wish I was smart enough to pull it off :) Thanks, Tom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jun 23, 2008, at 6:59 PM, TomRossi7 wrote:> Okay, someone smarter than me needs to add this to the Rails > framework. It would be great if whenever a new session_id is created, > the request object gets a "new_session?" attribute. This is kind-of > like the ActiveRecord object and the "new_record?" attribute.It''s already there, it just doesn''t use ? for some reason. If you output your session using <%= debug(session) %> you''ll see that there is a new_session key already. This works for me: <%= debug(session.new_session.to_s) %> and I get the appropriate true & false results. -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nice! Thanks Greg! I didn''t catch that in the API! On Jun 24, 4:13 pm, Greg Willits <li...-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> wrote:> On Jun 23, 2008, at 6:59 PM, TomRossi7 wrote: > > > Okay, someone smarter than me needs to add this to the Rails > > framework. It would be great if whenever a new session_id is created, > > the request object gets a "new_session?" attribute. This is kind-of > > like the ActiveRecord object and the "new_record?" attribute. > > It''s already there, it just doesn''t use ? for some reason. > > If you output your session using <%= debug(session) %> you''ll see > that there is a new_session key already. > > This works for me: <%= debug(session.new_session.to_s) %> > > and I get the appropriate true & false results. > > -- gw--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---