you can use content_for?(:header_action) here.
see http://guides.rubyonrails.org/layouts_and_rendering.html#understanding-yield and http://guides.rubyonrails.org/layouts_and_rendering.html#using-the-content-for-method