Module: Decidim::CtaButtonHelper
- Included in:
 - Decidim::ContentBlocks::HeroCell
 
- 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
 - 
  
    
      #cta_button_path  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Finds the CTA button path to reuse it in other places.
 - 
  
    
      #cta_button_text  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Renders the Call To Action button.
 
Instance Method Details
#cta_button ⇒ Object
      12 13 14  | 
    
      # File 'app/helpers/decidim/cta_button_helper.rb', line 12 def link_to , , class: "hero-cta button expanded large button--sc", title: t("decidim.pages.home.hero.participate_title") end  | 
  
#cta_button_path ⇒ Object
Finds the CTA button path to reuse it in other places.
      17 18 19 20 21 22 23 24 25 26 27 28 29  | 
    
      # File 'app/helpers/decidim/cta_button_helper.rb', line 17 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 elsif current_organization.sign_up_enabled? decidim.new_user_registration_path else decidim.new_user_session_path end end  | 
  
#cta_button_text ⇒ Object
Renders the Call To Action button. Link and text can be configured per organization.
      8 9 10  | 
    
      # File 'app/helpers/decidim/cta_button_helper.rb', line 8 def translated_attribute(current_organization.).presence || t("decidim.pages.home.hero.participate") end  |