Have a look at Florian Hanke's Representer plugin:

http://github.com/floere/representer

It allows you to have 'object oriented' views, maybe it suits your
needs...

Andi

On Oct 5, 10:19 am, Colin Law <clan...@googlemail.com> wrote:
> 2009/10/5 Jonas Latza <to.the.mat...@gmail.com>:
>
>
>
> > Hi,
>
> > How can I implement two different views on the same model? My model
> > has 30 attributes. The First view should display 1-12 and the second
> > view the rest of them.
>
> > In my case I am dealing with two medical anamneses with different
> > topics. My idea was to generate a model called anamnesis with every
> > field name of the two topics. This model should be split into two views.
>
> You could use a parameter in the url for the show action to indicate
> which view you want, then in the show action test the parameter and
> render the appropriate view.
> You could use a separate action in the controller.
> You could use a separate controller for the second view.
> If one view is showing some attributes and another only the rest (not
> clear from your post whether the second view shows all of them or
> not), then consider whether it should be a separate model.
>
> Colin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to