I''m using something like this:
def getsomedata
@data = my_method_that_returns_some_data()
render_action "commonview"
end
def getsomedata2
@data = my_method_that_returns_some_data2()
render_action "commonview"
end
def commonview
end
And a template named commonview.rhtml
Hope this helps.
cheers,
juca
On Tue, 15 Feb 2005 15:44:47 -0500, Jim Van Fleet
<jim-HW8W3q4hXPgyx5EpGhof3g@public.gmane.org>
wrote:> I''ve got a very simple domain up and running with Rails where
literally
> all of the useful information comes out of one domain object. This
> object, however, has a lot of information and needs to be searched
> according to various criteria.
>
> I have a partial that handles displaying one of these beasts. Views are
> then extremely simple, they just render_collection_of_partials on the
> variable made available by the controller. (BTW, did I mention I love
> Rails? I''m still trying to figure this out with WebWork/OGNL.)
>
> The controller methods all do something a little different to populate
> that variable. So I have about 20 controller methods (in different
> controllers), using the same view.
>
> Is there a way to avoid the need to create specialized .rhtml files for
> this? What''s the group''s recommendation for doing so? I
have some
> ideas, but I want to see if someone has a slam-dunk answer ready.
>
> Cheers,
>
> Jim
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
juraci krohling costa