Module: Decidim::RichTextEditorHelper

Included in:
AmendmentsHelper
Defined in:
app/helpers/decidim/rich_text_editor_helper.rb

Overview

Helper related to organization’ setting :rich_text_editor_in_public_views.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'app/helpers/decidim/rich_text_editor_helper.rb', line 6

def self.included(base)
  base.include Decidim::SanitizeHelper
end

Instance Method Details

#text_editor_for(form, attribute, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/decidim/rich_text_editor_helper.rb', line 12

def text_editor_for(form, attribute, options = {})
  if rich_text_editor_in_public_views?
    options[:lines] ||= 25
    form.editor attribute, options
  else
    options.delete(:hashtaggable)
    options[:rows] ||= 10
    form.text_area attribute, options
  end
end