I have a view with this :
<%= render 'test' do %>
test
<% end %>
And a partial like this :
<%= yield %>
When I go to the view, I want to see "test" but I see nothing.
Is there a way to yield a block inside a partial?
You need to specify that given partial behaves as a layout:
<%= render layout: 'test' do %>
test
<% end %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.