对不起,我不会用英文的具体表达。
index.erb
<h1>Hello World.</h1>
<ul>
<li>item1</li>
<li>item2</li>
</ul>
<% capture_content :key do %>
I'm Here.
<% end %>
helpers
def capture_content(key, &block)
@content_hash = {}
@content_hash[key] = block.call # this block contains erb all
end
我只想要capture_content
内容
希望表达正确T_T