Class: Decidim::Posts::PostPresenter

Inherits:
ResourcePresenter
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper, SanitizeHelper
Defined in:
app/presenters/decidim/posts/post_presenter.rb

Overview

Decorator for Posts

Instance Method Summary collapse

Instance Method Details

#body(links: true, extras: true, strip_tags: false, all_locales: false) ⇒ Object



27
28
29
30
31
# File 'app/presenters/decidim/posts/post_presenter.rb', line 27

def body(links: true, extras: true, strip_tags: false, all_locales: false)
  return unless post

  content_handle_locale(post.body, all_locales, extras, links, strip_tags)
end

#editor_body(all_locales: false, extras: true) ⇒ Object



33
34
35
# File 'app/presenters/decidim/posts/post_presenter.rb', line 33

def editor_body(all_locales: false, extras: true)
  editor_locales(post.body, all_locales, extras:)
end

#postObject



13
14
15
# File 'app/presenters/decidim/posts/post_presenter.rb', line 13

def post
  __getobj__
end

#post_pathObject



17
18
19
# File 'app/presenters/decidim/posts/post_presenter.rb', line 17

def post_path
  Decidim::ResourceLocatorPresenter.new(post).path
end

#title(links: false, extras: true, html_escape: false, all_locales: false) ⇒ Object



21
22
23
24
25
# File 'app/presenters/decidim/posts/post_presenter.rb', line 21

def title(links: false, extras: true, html_escape: false, all_locales: false)
  return unless post

  super post.title, links, html_escape, all_locales, extras:
end