Skip to content

Instantly share code, notes, and snippets.

@tubbo
Forked from chewmanfoo/helper.rb
Created November 8, 2012 19:13
Show Gist options
  • Select an option

  • Save tubbo/4040872 to your computer and use it in GitHub Desktop.

Select an option

Save tubbo/4040872 to your computer and use it in GitHub Desktop.
<div id="header_block">
<div id="header_block_title"><%= title %></div>
<div id="header_block_content"><%= content %></div>
</div>
<!--
call it with:
<%= render 'header_block', title: "Something", content: "A bit more" %>
-->
def header_block(title, content)
content_tag :div, header_block_title(title)+header_block_content(content), id: 'header_block'
end
def header_block_title(title)
content_tag :div, title, id: 'header_block_title'
end
def header_block_content(content)
content_tag :div, content, id: 'header_block_content'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment