How to fetch a block provided by content_for in a helper?


I got a title_tag helper that renders default page title or title
provided by content_for block, if such block is present. Currently I
call this method like this: “title_tag(yield(:title))”. Is it possible
to fetch :title block inside the helper without explicitly passing it
as a parameter to this helper?

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