Module: Spurs::Section::Helper
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/spurs/section/helper.rb
Instance Method Summary collapse
- #spurs_collapsible_section(title, options = {}, &block) ⇒ Object
- #spurs_section(title, options = {}, &block) ⇒ Object
- #spurs_vcenter(options = {}, &block) ⇒ Object
Instance Method Details
#spurs_collapsible_section(title, options = {}, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/spurs/section/helper.rb', line 6 def spurs_collapsible_section(title,={},&block) opts = Spurs::Section::.merge() if !opts[:builder] raise "Null builder" end = {} builder = opts[:builder].new() section_content = capture(nil,&block) builder.build_collapsible_section(title.html_safe,section_content.html_safe) end |
#spurs_section(title, options = {}, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/spurs/section/helper.rb', line 18 def spurs_section(title,={},&block) opts = Spurs::Section::.merge() if !opts[:builder] raise "Null builder" end = {} builder = opts[:builder].new() section_content = capture(nil,&block) builder.build_section(title.html_safe,section_content.html_safe) end |
#spurs_vcenter(options = {}, &block) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/spurs/section/helper.rb', line 30 def spurs_vcenter(={}, &block) opts = .clone if !opts[:class] opts[:class] = "" end opts[:class] = "vcenter_outer ".concat(opts[:class]) # extract inner options inner_opts = opts[:inner_html] ? opts.delete(:inner_html) : {} if !inner_opts[:class] inner_opts[:class] = "" end inner_opts[:class].concat(" inner") section_content = capture(nil,&block) content_tag(:div,content_tag(:div, content_tag(:div,section_content,inner_opts),:class => "middle"),opts) end |