Module: Decidim::CtaButtonHelper
- Defined in:
- app/helpers/decidim/cta_button_helper.rb
Overview
A Helper to render the Call To Action button.
Instance Method Summary collapse
-
#cta_button ⇒ Object
Renders the Call To Action button.
-
#cta_button_path ⇒ Object
Finds the CTA button path to reuse it in other places.
Instance Method Details
#cta_button ⇒ Object
Renders the Call To Action button. Link and text can be configured per organizationn.
8 9 10 11 12 |
# File 'app/helpers/decidim/cta_button_helper.rb', line 8 def = translated_attribute(current_organization.).presence || t("pages.home.hero.participate") link_to , , class: "hero-cta button expanded large button--sc" end |
#cta_button_path ⇒ Object
Finds the CTA button path to reuse it in other places.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/decidim/cta_button_helper.rb', line 15 def if current_organization..present? current_organization. elsif Decidim::ParticipatoryProcess.where(organization: current_organization).published.any? decidim_participatory_processes.participatory_processes_path elsif current_user decidim.account_path else decidim.new_user_registration_path end end |