Module: Decidim::Posts::PostsHelper
- Includes:
- ApplicationHelper, Meetings::ApplicationHelper, ResourceHelper, TranslationsHelper
- Defined in:
- app/helpers/decidim/posts/posts_helper.rb
Overview
Custom helpers used in posts views
Instance Method Summary collapse
- #calendar_months ⇒ Object
- #collection ⇒ Object
- #limit ⇒ Object
- #meetings ⇒ Object
- #participatory_space ⇒ Object
Instance Method Details
#calendar_months ⇒ Object
12 13 14 |
# File 'app/helpers/decidim/posts/posts_helper.rb', line 12 def calendar_months [Date.current, Date.current.next_month] end |
#collection ⇒ Object
16 17 18 |
# File 'app/helpers/decidim/posts/posts_helper.rb', line 16 def collection @collection ||= meetings.limit(limit) end |
#limit ⇒ Object
24 25 26 |
# File 'app/helpers/decidim/posts/posts_helper.rb', line 24 def limit 3 end |
#meetings ⇒ Object
20 21 22 |
# File 'app/helpers/decidim/posts/posts_helper.rb', line 20 def meetings @meetings ||= show_upcoming_meetings? ? upcoming_meetings : past_meetings end |
#participatory_space ⇒ Object
28 29 30 |
# File 'app/helpers/decidim/posts/posts_helper.rb', line 28 def participatory_space @participatory_space ||= current_component.participatory_space end |