Use a Builder rxml template for more than one controller in Rails 1.2?

I’m trying to do the equivalent in Rails 1.2 of

def method_for_controller_one
render(:controller => ‘controller_two’, :action => ‘rss’)
end

but instead of using a view rss.rhtml, I want to use a Builder
template rss.rxml that’s in the controller_two directory for display.

I hate to have the same rss.rxml file in multiple controller
directories, but can’t figure out how to reuse the same template.
Thanks.

Partials might give you exactly what you need…

On 20 Aug 2008, at 11:33, Wolas! wrote:

but instead of using a view rss.rhtml, I want to use a Builder
template rss.rxml that’s in the controller_two directory for display.

I hate to have the same rss.rxml file in multiple controller
directories, but can’t figure out how to reuse the same template.

render :template takes a template path from your view root (ie /app/
views). render :partial is also able to do stuff like render :partial
=> ‘somewhere_else/foo’

Fred

Thanks, render :template did the trick.

On Aug 20, 6:42 am, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs