Forum: Ruby on Rails RESTful design with multiple model types on one page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2009-03-08 11:09
(Received via mailing list)
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.
8d295740bdc6fecc406cff2e8b895f48?d=identicon&s=25 sahil (Guest)
on 2009-03-09 06:23
(Received via mailing list)
On Mar 8, 3:09 pm, Colin Law <clan...@googlemail.com> 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
This topic is locked and can not be replied to.