Module: Viewaide::Helpers::StructureHelper
- Included in:
- Viewaide::Helpers
- Defined in:
- lib/viewaide/helpers/structure_helper.rb
Instance Method Summary collapse
-
#blockquote(*args, &block) ⇒ String
Generate a blockquote.
-
#body(*args) ⇒ String
Allows assignment of <body> attributes.
Instance Method Details
#blockquote(*args, &block) ⇒ String
Generate a blockquote
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/viewaide/helpers/structure_helper.rb', line 20 def blockquote(*args, &block) = args. = .delete(:author) option_quote = textilize(.delete(:quote)) bq = content_tag :blockquote, option_quote.blank? ? capture(&block) : option_quote html = if content_tag :div, bq + content_tag(:cite, ), :class => "quote-cited" else bq end concat(html) end |
#body(*args) ⇒ String
Allows assignment of <body> attributes. The body (when accepting a block) should be used in your application’s layout
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/viewaide/helpers/structure_helper.rb', line 59 def body(*args) = args. @_page_body_attributes ||= {} css_classes = [] << @_page_body_attributes.delete(:class) << args @_page_body_attributes = @_page_body_attributes.merge() @_page_body_attributes[:class] = clean_css_classes(css_classes) if block_given? block = lambda { yield } html = content_tag(:body, capture(&block), @_page_body_attributes) concat(html) end end |