Skip to content

Instantly share code, notes, and snippets.

@rylwin
Created June 9, 2013 23:52
Show Gist options
  • Save rylwin/5745785 to your computer and use it in GitHub Desktop.
Save rylwin/5745785 to your computer and use it in GitHub Desktop.
module UIHelper
def box(title=nil, opts={}, &block)
title = "<h4>#{title}</h4>".html_safe if title
body = content_tag(:span, with_output_buffer(&block), :class => 'content')
box_class = @management ? 'well' : 'box'
opts[:class] = "#{box_class} #{opts[:class]}".squish
content_tag(:div, title + body, opts).html_safe
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment