Class: Decidim::Posts::PostCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Posts::PostCell
show all
- Includes:
- Cell::ViewModel::Partial, PostCellsHelper
- Defined in:
- app/cells/decidim/posts/post_cell.rb
Instance Method Summary
collapse
#component_settings, #current_component, #current_settings, #participatory_space
#category_label, #category_label_singular, #posts_component_for_meeting
Instance Method Details
#has_image? ⇒ Boolean
37
38
39
|
# File 'app/cells/decidim/posts/post_cell.rb', line 37
def has_image?
resource_image_path.present?
end
|
#post ⇒ Object
13
14
15
|
# File 'app/cells/decidim/posts/post_cell.rb', line 13
def post
model
end
|
#post_body ⇒ Object
17
18
19
|
# File 'app/cells/decidim/posts/post_cell.rb', line 17
def post_body
simple_format(post_presenter.body)
end
|
#post_category ⇒ Object
25
26
27
|
# File 'app/cells/decidim/posts/post_cell.rb', line 25
def post_category
model.category
end
|
29
30
31
|
# File 'app/cells/decidim/posts/post_cell.rb', line 29
def
model.
end
|
#post_presenter ⇒ Object
21
22
23
|
# File 'app/cells/decidim/posts/post_cell.rb', line 21
def post_presenter
@post_presenter ||= present(model)
end
|
#resource_image_path ⇒ Object
33
34
35
|
# File 'app/cells/decidim/posts/post_cell.rb', line 33
def resource_image_path
model.attachments.first&.url
end
|
#show ⇒ Object
9
10
11
|
# File 'app/cells/decidim/posts/post_cell.rb', line 9
def show
render :show
end
|