It would be nice to be able to use blocks when rendering templates, similar to partial layouts.
With partial layouts, the following is possible (with layouts/_special.html.erb
):
<%= render layout: “layouts/special” do %>
…
<% end %>
This requires the layout to be a partial layout. It would be convenient however to have the same option when rendering any template:
<%= render template: “layouts/application” do %>
<% end %>
The most obvious use case is creating a layout file adding some extra structure in the main content area of the application layout. This would seem to be a cleaner solution to nested layouts1, since the application layout need not be changed. (The chaining/subtemplating considerations described in the guide would be unnecessary.)
Thoughts?
Best,
Johannes