Web Development  >>  Ruby On Rails

Layouts and content_for

Language : English Quality : High Has Audio : true Source : Other Media : n/a
If you want to change something in the layout on a per-template basis, content_for is your answer! This allows templates to specify view code that can be placed anywhere in a layout.

Tags: Ruby On Rails, Ruby, Web Development, Screencast, Template,     [SUGGEST  A  TAG]

Resources referenced in this screencast
  • Ruby on Rails

  • Created : 2007-03-21   Duration : 03:30

    Articles Realted to this Topic

    [SUGGEST  A  ARTICLE]
    Best Practices of Sidebars & Layouts in Ruby on Rails
    This surprises even me, but I’m not sure what is the best way to provide multiple templates, sidebars, etc. (i.e. typical layout/templating stuff) before I read this. Formerly I exclusively use partials, now I know there’s another way, the content_for and yield. It’s not something that all beginner Railers know (including me) so I thought this’d be a great & very useful read
    content_for best practices
    wanting to keep DRY, i'm wondering what the best way is to use this is if i'm wanting to check specific areas for content. based on if there is or isn't, i would like to totally remove or add elements to the page.