Skip to content

Instantly share code, notes, and snippets.

@dekart
Created April 28, 2010 17:14
Show Gist options
  • Select an option

  • Save dekart/382396 to your computer and use it in GitHub Desktop.

Select an option

Save dekart/382396 to your computer and use it in GitHub Desktop.
def box(*args, &block)
options = args.extract_options!
content = block_given? ? capture(&block) : args.shift
result = '<div class="box">%s</div>' % content
result.html_safe!
block_given? ? concat(result) : result
end
<% box do %>
Content goes here
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment