Hi, I try to do with my app something like twitter.com has, when you are NOT logged in it shows twitter.com, when you are logged in it keeps the same domain name in browser, but all page has been changed(it''s full with tweets), anybody? How to do this? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 10 Aug 2010, at 13:10, Ainar Abramovich <youhubcommunity-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I try to do with my app something like twitter.com has, when you > are NOT logged in it shows twitter.com, when you are logged in it > keeps the same domain name in browser, but all page has been > changed(it''s full with tweets), anybody? How to do this?You could just use an if statement in the controller action: if logged_in? # set up logged-in stuff render :action => ''some_template'' else # set up not-logged-in stuff render :action => ''some_other_template'' end Replace #logged_in? with whatever''s appropriate for your authentication system. Chris -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks very fast and useful answer, again Thanks On Aug 10, 3:16 pm, Chris Mear <chrism...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10 Aug 2010, at 13:10, Ainar Abramovich <youhubcommun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, I try to do with my app something like twitter.com has, when you > > are NOT logged in it shows twitter.com, when you are logged in it > > keeps the same domain name in browser, but all page has been > > changed(it''s full with tweets), anybody? How to do this? > > You could just use an if statement in the controller action: > > if logged_in? > # set up logged-in stuff > render :action => ''some_template'' > else > # set up not-logged-in stuff > render :action => ''some_other_template'' > end > > Replace #logged_in? with whatever''s appropriate for your authentication system. > > Chris-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
BTW does anyone know place where to look for templates? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.