Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save thesunwave/b46d3d01b0ab1382ddf53d5914e5864d to your computer and use it in GitHub Desktop.

Select an option

Save thesunwave/b46d3d01b0ab1382ddf53d5914e5864d to your computer and use it in GitHub Desktop.

Revisions

  1. @bunnymatic bunnymatic created this gist Dec 6, 2012.
    17 changes: 17 additions & 0 deletions nested_content_snippet.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # because i can never remember exactly how and when to use concat
    # when building content in helpers
    def nested_content
    content_tag 'div' do
    concat(content_tag 'span', 'span block')
    concat(tag 'br')
    concat(link_to 'root link', root_path)
    concat(tag 'br')
    concat(link_to('#') do
    concat(content_tag 'h2', 'Head \'em off')
    concat(tag 'br')
    content_tag 'div', (content_tag 'span',(concat 'dudue'))
    end)
    end
    end