Rendering partials on another controller

Hi,

I was trying to include a view inside my application.rhtml layout, and I
found that render_component seemed to be the answer. Unfortunately, it
doesn’t understand the “:layout => false” option (like a normal render),
and also doesn’t seem to be able to render partials at all.

So is there a way to do what I’m trying? short of using a custom layout
on this “component” and deleting the default one?

I also tried using “render” directly inside the layout, but it doesn’t
output anything at all.

Thanks in advance!

Ivan V.

If you have a partial in say, ‘app/views/users/_form.rhtml’ and you want
to
render this from anywhere in your app you could use:
render :partial=>"/users/form"
This will hopefully give you what you want. And since its a partial, you
don’t need to use layout=>false. The render_components method is for
rendering controllers/views from the components directory and is quite
different.

Hope this helps!
-Nick

I should have guessed it would be so simple… Thanks a lot!

Ivan V.

No problem. I still find myself trying to make things to complicated as
well. :slight_smile: