Render_component vs. render_component_as_string?

I’m calling render_component in a helper.

render_component :controller => target_controller, :action => “show”,
:id => target_id

This works fine, except that passing the id in :params didn’t work and
I had to pass in an explicit :id parameter to get the target
controller to override the id - is that documented anywhere?

That’s not my question. My question is - if I replace this with
render_component_as_string, then try to render the string, I get an
error:

renderstring = render_component_as_string :controller =>
target_controller, :action => “show”, :id => target_id
render :inline => renderstring

throws a undefined method error for render_component_as_string. Is
this method not available in helpers? Is there an alternate approach
to use for the same effect?

Thanks!


- Adam

** Expert Technical Project and Business Management
**** System Performance Analysis and Architecture
****** [ http://www.everylastounce.com ]

[ Adam Fields (weblog) - - entertaining hundreds of millions of eyeball atoms every day ] … Blog
[ Adam Fields Resume ]… Experience
[ Adam Fields | Flickr ] … Photos
[ http://www.aquicki.com/wiki ]…Wiki
[ http://del.icio.us/fields ] … Links

On Wed, Feb 08, 2006 at 09:25:59AM -0500, Adam F. wrote:

renderstring = render_component_as_string :controller => target_controller, :action => “show”, :id => target_id
render :inline => renderstring

throws a undefined method error for render_component_as_string. Is
this method not available in helpers? Is there an alternate approach
to use for the same effect?

Reading the API docs, I’ve realized that render_component_as_string is
a protected method, so of course it’s not going to work.

Is there a public way to get the contents of an action render as a
string from an arbitrary controller?


- Adam

** Expert Technical Project and Business Management
**** System Performance Analysis and Architecture
****** [ http://www.everylastounce.com ]

[ Adam Fields (weblog) - - entertaining hundreds of millions of eyeball atoms every day ] … Blog
[ Adam Fields Resume ]… Experience
[ Adam Fields | Flickr ] … Photos
[ http://www.aquicki.com/wiki ]…Wiki
[ http://del.icio.us/fields ] … Links