Module: RobinsHtmlHelpers
- Defined in:
- lib/robins_html_helpers.rb
Instance Method Summary collapse
-
#boxed_content(options = {}, &block) ⇒ Object
TODO: Document the options argument.
Instance Method Details
#boxed_content(options = {}, &block) ⇒ Object
TODO: Document the options argument
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/robins_html_helpers.rb', line 4 def boxed_content( = {}, &block) # Default class names [:bottom_left_class] ||= 'box_bottom_left' [:bottom_right_class] ||= 'box_bottom_right' [:top_left_class] ||= 'box_top_left' [:top_right_class] ||= 'box_top_right' if [:inner_class] [:inner_class] = [:inner_class] + " " + [:top_right_class] else [:inner_class] = [:top_right_class] end if [:outer_class] [:outer_class] = [:outer_class] + " " + [:bottom_left_class] else [:outer_class] = [:bottom_left_class] end concat( content_tag(:div, :style => "padding-top: 1px;") do # Extra div to fix margin problems in IE 6 content_tag(:div, :class => [:outer_class], :id => [:outer_id] ) do content_tag(:div, :class => [:bottom_right_class]) do content_tag(:div, :class => [:top_left_class]) do content_tag(:div, :class => [:inner_class], :id => [:inner_id]) do capture(&block) end end end end end ) end |