Simple question about yield :layout for Rails 2.3 app

I'm maintaining and old app. I'm seeing in the layouts they've used

    <body>
        <%= yield :layout %>
    </body>

rather than just a simple <%= yield %>

I'm guessing these are equivalent, but can someone give me a
history/explanation of the <%= yield :layout %> convention?

I can't seem to be able to find any mention of it in old docs.

Thanks

unsubscribe

Steve Lack
310-737-8686
Skype: stevenlack1
Live Chat: http://genlack.com/

You can also find me on: [image: Twitter]
<http://www.twitter.com/Genlack>[image:
Facebook] <http://www.facebook.com/pages/Genlackcom/282160767069>[image:
Linkedin] <http://www.linkedin.com/in/stevelack>

···

On Thu, Nov 6, 2014 at 10:51 AM, bruka <bruka@idatainc.com> wrote:

I'm maintaining and old app. I'm seeing in the layouts they've used

    <body>
        <%= yield :layout %>
    </body>

rather than just a simple <%= yield %>

I'm guessing these are equivalent, but can someone give me a
history/explanation of the <%= yield :layout %> convention?

I can't seem to be able to find any mention of it in old docs.

Thanks

This isn't something thats been deprecated from rails, its also present in
4.1.7 and its very commonly used.

I can point you to the appropriate docs here:
http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for

Cheers

George

···

On Thu, Nov 6, 2014 at 3:51 PM, bruka <bruka@idatainc.com> wrote:

I'm maintaining and old app. I'm seeing in the layouts they've used

    <body>
        <%= yield :layout %>
    </body>

rather than just a simple <%= yield %>

I'm guessing these are equivalent, but can someone give me a
history/explanation of the <%= yield :layout %> convention?

I can't seem to be able to find any mention of it in old docs.

Thanks

--

6-8 Long Lane, London EC1A 9HF
+44 (0)333 240 2222
www.rentify.com

I think you misunderstood my question.

I asked about the :layout symbol specifically, not the general yielding to
a specific block associated with content_for, i.e. <%= yield :head %>

The <%= yield :layout %> is not associated with a content_for and it is in
fact yielding to the view template, same as plain <%= yield %>

···

On Thu, Nov 6, 2014 at 11:22 AM, George Drummond <drummond@rentify.com> wrote:

This isn't something thats been deprecated from rails, its also present in
4.1.7 and its very commonly used.

I can point you to the appropriate docs here:
http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for

Cheers

George

On Thu, Nov 6, 2014 at 3:51 PM, bruka <bruka@idatainc.com> wrote:

I'm maintaining and old app. I'm seeing in the layouts they've used

    <body>
        <%= yield :layout %>
    </body>

rather than just a simple <%= yield %>

I'm guessing these are equivalent, but can someone give me a
history/explanation of the <%= yield :layout %> convention?

I can't seem to be able to find any mention of it in old docs.

Thanks

6-8 Long Lane, London EC1A 9HF
+44 (0)333 240 2222
www.rentify.com

--

Besnik Ruka – Software Engineer at IData Inc.

support@datacookbook.com

www.idatainc.com

703-378-2110 x 809