Module: EaselHelpers::Helpers::StructureHelper

Included in:
EaselHelpers::Helpers
Defined in:
lib/easel_helpers/helpers/structure_helper.rb

Instance Method Summary collapse

Instance Method Details

#blockquote(*args, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/easel_helpers/helpers/structure_helper.rb', line 5

def blockquote(*args, &block)
  options = args.extract_options!
  author = options.delete(:author)
  option_quote = textilize(options.delete(:quote))

  bq =   :blockquote,
                    option_quote.blank? ? capture(&block) : option_quote

  html = if author
     :div,
                bq + (:cite, author),
                :class => "quote-cited"
  else
    bq
  end

  concat(html)
end

#body(*args) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/easel_helpers/helpers/structure_helper.rb', line 24

def body(*args)
  options = args.extract_options!
  @_page_body_attributes ||= {}

  css_classes = [] << @_page_body_attributes.delete(:class) << args

  @_page_body_attributes = @_page_body_attributes.merge(options)
  @_page_body_attributes[:class] = clean_css_classes(css_classes)

  if block_given?
    block = lambda { yield }

    html = (:body, capture(&block), @_page_body_attributes)
    concat(html)
  end
end