Rendering directly from the controller into a named section of my layout

My layouts/application.rhtml contains:

<%= yield :main %>

I would like to render directly from my controller into the :main
section - that is, without using the usual view incantation:

% content_for (:main) do %>
i am not crazy
<% end %>

Instead, directly from my controller, I want to (essentially) do a

render :text => "I am not crazy"

And have that go into the :main section of my layout file.

Note: why do I want this? I believe this is a generally valid
question, but if you are curious, I am using ActiveScaffold which
automagically provides scaffold views dynamically so you don’t even
write actual views. But my layouts are still in play and I need to get
the dynamic scaffolds to go in the right place. … Maybe I am looking
at this in the wrong way…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs