# How to display results from 2 views

**URL:** <https://www.ruby-forum.com/t/how-to-display-results-from-2-views/176896>\
**Category:** Rails\
**Created:** [October 7, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/how-to-display-results-from-2-views/176896 "2009-10-07T21:14:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josihovo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@josihovo](https://www.ruby-forum.com/u/josihovo)\
**Post date:** [October 7, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/how-to-display-results-from-2-views/176896/1 "2009-10-07T21:14:05Z")

</div>

Plz Help…

```
   I just started studying Ruby so plz don't mind if my question is

```

too novice for this forumm.

I have made 2 simple database tables clients and servers and used  
scaffold to generate controller and views for the same. Now I can view  
all the available clients and servers by going to  
[http://localhost/3000/clients](http://localhost/3000/clients) and to [http://localhost/3000/servers](http://localhost/3000/servers), I  
need to display both the data on the same page, say after clients are  
displayed, the servers should be displayed. I tried using redirect\_to in  
the controller for clients but it gives an error “Cannot render twice”.  
I also tried using @servers = Server.find(:all) in the client Index page  
but still in vain.

How can I achieve this ?

Thank you,

---

<div class="post-metadata">

**Author:** ![josihovo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@josihovo](https://www.ruby-forum.com/u/josihovo)\
**Post date:** [October 7, 2009, 9:27pm UTC](https://www.ruby-forum.com/t/how-to-display-results-from-2-views/176896/2 "2009-10-07T21:27:30Z")

</div>

Avnish Malik wrote:

> Plz Help…  
> […] I need to display both the data on the same page […]

Time to make two partials.  
google search : rails partials

---

<div class="post-metadata">

**Author:** ![josihovo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@josihovo](https://www.ruby-forum.com/u/josihovo)\
**Post date:** [October 7, 2009, 10:06pm UTC](https://www.ruby-forum.com/t/how-to-display-results-from-2-views/176896/3 "2009-10-07T22:06:31Z")

</div>

2009/10/7 Aldric G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Avnish Malik wrote:
> 
> > Plz Help…  
> > […] I need to display both the data on the same page […]
> 
> Time to make two partials.  
> google search : rails partials

You will need a new action in one of your controllers, or more likely  
a new controller, that picks up @clients and @servers and then display  
them using partials as Aldric suggests.

Colin
