# RESTful design with multiple model types on one page

**URL:** <https://www.ruby-forum.com/t/restful-design-with-multiple-model-types-on-one-page/162306>\
**Category:** Rails\
**Created:** [March 8, 2009, 11:09am UTC](https://www.ruby-forum.com/t/restful-design-with-multiple-model-types-on-one-page/162306 "2009-03-08T11:09:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinloretz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@colinloretz](https://www.ruby-forum.com/u/colinloretz)\
**Post date:** [March 8, 2009, 11:09am UTC](https://www.ruby-forum.com/t/restful-design-with-multiple-model-types-on-one-page/162306/1 "2009-03-08T11:09:56Z")

</div>

I have a nice RESTful design with separate pages for viewing and  
modifying  
my models in the conventional RESTful way. I now wish to provide a web  
page  
with several panels where each panel is showing data for a different  
model  
type. Data entered in one panel will change the objects shown in  
another.  
I am not sure of the best way to impliment this. Should I have an  
independant controller (with no model of it’s own) to manage this, which  
obtains data from the various models and renders it’s view, using  
partials  
to display the panels? Is there a better way?

I am sure this has been answered many times before but I have not seen  
the  
problem identified in discussions of REST that I have found, and I have  
not  
managed to formulate a google search to provide the answer.

Any suggestions would be much appreciated.

---

<div class="post-metadata">

**Author:** ![colinloretz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@colinloretz](https://www.ruby-forum.com/u/colinloretz)\
**Post date:** [March 9, 2009, 6:23am UTC](https://www.ruby-forum.com/t/restful-design-with-multiple-model-types-on-one-page/162306/2 "2009-03-09T06:23:00Z")

</div>

On Mar 8, 3:09 pm, Colin L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a nice RESTful design with separate pages for viewing and modifying  
> my models in the conventional RESTful way. I now wish to provide a web page  
> with several panels where each panel is showing data for a different model  
> type. Data entered in one panel will change the objects shown in another.  
> I am not sure of the best way to impliment this. Should I have an  
> independant controller (with no model of it’s own) to manage this, which  
> obtains data from the various models and renders it’s view, using partials  
> to display the panels? Is there a better way?

you can use the same controller to do this. just use partials for  
different models. Are the models associated? if yes, then it may be a  
bit complex. if not, then it would be quite easy.  
as for observing the changes, you could use the observe\_field method  
of prototypehelper
