Class: Georgia::RevisionDecorator
- Inherits:
-
ApplicationDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- Georgia::RevisionDecorator
- Defined in:
- app/decorators/georgia/revision_decorator.rb
Instance Method Summary collapse
Instance Method Details
#excerpt_or_text ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/decorators/georgia/revision_decorator.rb', line 4 def excerpt_or_text if content.excerpt.present? h.raw(content.excerpt) elsif content.text.present? h.truncate(h.(content.text), length: 255, separator: ' ').html_safe end end |
#meta_description ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/decorators/georgia/revision_decorator.rb', line 12 def if content.excerpt.present? content.excerpt.squish elsif content.text.present? h.truncate(h.(content.text).squish, length: 240, separator: ' ').html_safe end end |
#status_tag(options = {}) ⇒ Object
20 21 22 23 24 25 |
# File 'app/decorators/georgia/revision_decorator.rb', line 20 def status_tag(={}) [:class] ||= '' [:class] << ' label' [:class] << " label-#{human_state_name}" h.content_tag(:span, human_state_name, ) end |