Concatenating Two Views

any file that starts with and underline (_advert.rhtml) is actually a partial. To display another partial you simply call render(:partial => “shared/advert”) again, though you may want to rethink how you’re printing it to the overall view. Instead of setting a variable to hold your render partial, maybe just print it straight to the view

[view] <%= render(:partial => “my_partial”) %> [/view]

otherwise if you absolutely need to concat the two, I believe that partial simply returns a string so if you must you should be able to do this:

[view] <% content_for_right = (render(:partial => “user_profile”) + render(:partial => “advert”)) %> [/view]

It’s possible to do, but you may want to reconsider your approach the layout of your page.

It looks like you would also be interested in the “content_for” method. Check out the api or this article on “Err the Blog”:

http://errtheblog.com/post/28