many partials in one view

Is it possible to render 5 different partials in one view, each of which is rendered by an instance variable from a different action? Or must all instance variables that render all partials for a given view come from the same action?

Charlie

Well there is a component structure that creates a completely new request, but if you want 5 per one page, then say good bye to any sort of quick response time.

Otherwise no, you need to have the variables set by the related controller / action.

Jason

Only one action is performed at a time (unless you use components), so everything needs to be set from there or in something called from there.

But don't use instance variables in partials: http://www.robertshowalter.com/articles/2007/07/24/dont-use-instance-variables-in-partials

Like Bob said, don't use instance vars for partials. Have a look at this article for some guidelines on combing views, layouts, and partials to achieve modular design and retain OOP objectives.

http://www.railsdev.ws/blog/3/modular-page-assembly-in-rails/

-- greg willits