Render arguments :locals and :layout only available on partials?

It looks to me like the :locals and :layout arguments for the render
call don’t do anything unless you are rendering a :partial.

Is that right or am I misdiagnosing what’s happening to me?

I think you are right with :locals as that is specifically designed
for passing variables into the partial to be used within the local
scope of that partial. But :layout is for any render. You can specify
a different layout or tell it to use none, i.e. :layout => false


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