Class: Decidim::Posts::PostPresenter
- Inherits:
-
ResourcePresenter
- Object
- ResourcePresenter
- Decidim::Posts::PostPresenter
- Includes:
- ActionView::Helpers::UrlHelper, SanitizeHelper
- Defined in:
- app/presenters/decidim/posts/post_presenter.rb
Overview
Decorator for Posts
Instance Method Summary collapse
- #body(links: true, extras: true, strip_tags: false, all_locales: false) ⇒ Object
- #editor_body(all_locales: false, extras: true) ⇒ Object
- #post ⇒ Object
- #post_path ⇒ Object
- #title(links: false, extras: true, html_escape: false, all_locales: false) ⇒ Object
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, ) 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 |
#post ⇒ Object
13 14 15 |
# File 'app/presenters/decidim/posts/post_presenter.rb', line 13 def post __getobj__ end |
#post_path ⇒ Object
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 |