say i wanted for a user to go to http://www.domain.com/intro when they first hit http://www.domain.com/ subsequent visits to the site while still on the current session would result in just going to http://www.domain.com/ basically the user only sees www.domain.com/intro once, and only once... unless they explicitly put in the ''/intro'' manually. thoughts? ideas? links? tutorials? -- 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 -~----------~----~----~----~------~----~------~--~---
the user hits /intro for the first time in the site, or for the first time per session? if you want him to see /intro for the first time entering the site, and the next week when he comes to visit your site, you don''t want him to see it, you should probably cookie him. if not, session is the way to go. and in the controller you''ve routed the homepage to, just do a before_filter to the homepage action, and add a if session[:visited?] clause or something like that to do a redirect. good enough? -- 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 -~----------~----~----~----~------~----~------~--~---
On 6/27/07, mason <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > say i wanted for a user to go to http://www.domain.com/intro when they > first hit http://www.domain.com/ > > subsequent visits to the site while still on the current session would > result in just going to http://www.domain.com/ > > basically the user only sees www.domain.com/intro once, and only once... > unless they explicitly put in the ''/intro'' manually.Assuming "/" maps to action "index" and "/intro" maps to action "intro", you would def index unless session[:intro_seen] redirect_to :action => "intro" return end end def intro session[:intro_seen] = true end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---