Question about template

In some application (check from railsday svn) ,i’ll notice this code:

<%= yield :something %>

What does this mean ? When use it ?

Sorry if question was ever posted but i can’t find it.

Thanks


djtal

Hello Guillaume,

In some application (check from railsday svn) ,i’ll notice this code:

<%= yield :something %>

What does this mean ?

yield is the Ruby yield.

When use it ?

It’s equivalent to @content_for_something

also <%= yield %> is equivalent to <%= @content_for_layout %> .

But using the @content_for* variables instances directly is deprecated
now in Edge.

Sorry if question was ever posted but i can’t find it.

HTH,
РJean-Fran̤ois.

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