How to display results from 2 views

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 and to 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,

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

2009/10/7 Aldric G. [email protected]:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs