Class: Decidim::Elections::ElectionPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
SanitizeHelper, TranslatableAttributes
Defined in:
decidim-elections/app/presenters/decidim/elections/election_presenter.rb

Overview

Decorator for election

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_newsletter, #decidim_url_escape, included

Instance Method Details

#description(strip_tags: false) ⇒ Object


21
22
23
24
25
# File 'decidim-elections/app/presenters/decidim/elections/election_presenter.rb', line 21

def description(strip_tags: false)
  content = translated_attribute(election.description)
  content = strip_tags(content) if strip_tags
  content
end

#electionObject


12
13
14
# File 'decidim-elections/app/presenters/decidim/elections/election_presenter.rb', line 12

def election
  __getobj__
end

#titleObject


16
17
18
19
# File 'decidim-elections/app/presenters/decidim/elections/election_presenter.rb', line 16

def title
  content = translated_attribute(election.title)
  decidim_html_escape(content)
end