Module: Decidim::Meetings::MeetingsHelper
- Includes:
- ApplicationHelper, ResourceHelper, TranslationsHelper
- Included in:
- ApplicationHelper
- Defined in:
- decidim-meetings/app/helpers/decidim/meetings/meetings_helper.rb
Overview
Custom helpers used in meetings views
Instance Method Summary collapse
-
#meeting_description(meeting, max_length = 120) ⇒ Object
Public: truncates the meeting description.
Methods included from ResourceHelper
#linked_classes_filter_values_for, #linked_classes_for, #linked_resources_for, #resource_locator
Methods included from TranslationsHelper
multi_translation, #translated_attribute
Methods included from ApplicationHelper
Methods included from ScopesHelper
Methods included from OmniauthHelper
#any_social_provider_enabled?, #normalize_provider_name, #social_provider_enabled?
Instance Method Details
#meeting_description(meeting, max_length = 120) ⇒ Object
Public: truncates the meeting description
meeting - a Decidim::Meeting instance max_length - a number to limit the length of the description
Returns the meeting’s description truncated.
17 18 19 20 21 22 |
# File 'decidim-meetings/app/helpers/decidim/meetings/meetings_helper.rb', line 17 def meeting_description(meeting, max_length = 120) link = resource_locator(meeting).path description = translated_attribute(meeting.description) tail = "... #{link_to(t("read_more", scope: "decidim.meetings"), link)}".html_safe CGI.unescapeHTML html_truncate(description, max_length: max_length, tail: tail) end |