Passing markup into a Rails Partial

Posted by 1ndivisible on Stack Overflow See other posts from Stack Overflow or by 1ndivisible
Published on 2012-10-25T10:57:34Z Indexed on 2012/10/25 11:00 UTC
Read the original article Hit count: 183

Is there any way of doing something equivilant to this:

<%= render partial: 'shared/outer'  do %>
    <%= render partial: 'shared/inner' %>
<% end %>

Resulting in

<div class="outer">
    <div class="inner">
    </div>
</div>

Obviously there would need to be a way of marking up 'shared/outer.html.erb' to indicate where the passed in partial should be rendered:

<div class="outer">
     <% render Here %>
</div>

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3