# Routing, need fast help

**URL:** <https://www.ruby-forum.com/t/routing-need-fast-help/193048>\
**Category:** Rails\
**Created:** [August 10, 2010, 2:11pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048 "2010-08-10T14:11:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ainar\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f6c823/32.png) [@Ainar\_A](https://www.ruby-forum.com/u/Ainar_A)\
**Post date:** [August 10, 2010, 2:11pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048/1 "2010-08-10T14:11:20Z")

</div>

Hi, I try to do with my app something like [twitter.com](http://twitter.com) has, when you  
are NOT logged in it shows [twitter.com](http://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?

---

<div class="post-metadata">

**Author:** ![Ainar\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f6c823/32.png) [@Ainar\_A](https://www.ruby-forum.com/u/Ainar_A)\
**Post date:** [August 10, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048/2 "2010-08-10T14:18:22Z")

</div>

On 10 Aug 2010, at 13:10, Ainar A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi, I try to do with my app something like [twitter.com](http://twitter.com) has, when you  
> are NOT logged in it shows [twitter.com](http://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

---

<div class="post-metadata">

**Author:** ![Ainar\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f6c823/32.png) [@Ainar\_A](https://www.ruby-forum.com/u/Ainar_A)\
**Post date:** [August 10, 2010, 2:23pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048/3 "2010-08-10T14:23:39Z")

</div>

Thanks very fast and useful answer, again Thanks

---

<div class="post-metadata">

**Author:** ![Ainar\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f6c823/32.png) [@Ainar\_A](https://www.ruby-forum.com/u/Ainar_A)\
**Post date:** [August 10, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/routing-need-fast-help/193048/4 "2010-08-10T15:08:08Z")

</div>

BTW does anyone know place where to look for templates?
