Class: Decidim::Posts::ContentBlocks::PostsCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Posts::ContentBlocks::PostsCell
show all
- Includes:
- Cell::ViewModel::Partial, PostCellsHelper
- Defined in:
- app/cells/decidim/posts/content_blocks/posts_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
#decidim_feeds ⇒ Object
25
26
27
|
# File 'app/cells/decidim/posts/content_blocks/posts_cell.rb', line 25
def decidim_feeds
Decidim::EngineRouter.main_proxy(component)
end
|
#posts_path ⇒ Object
29
30
31
|
# File 'app/cells/decidim/posts/content_blocks/posts_cell.rb', line 29
def posts_path
decidim_feeds.posts_path
end
|
#show ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/cells/decidim/posts/content_blocks/posts_cell.rb', line 9
def show
@posts = Decidim::Posts::Post
.where(decidim_component_id: component_id)
.filter_category(params[:filter_post_category])
.order(created_at: :desc)
.limit(6)
= {
current_component: component,
current_organization: component.organization,
current_user:,
current_participatory_space: component.participatory_space
}
render :show
end
|