Class: Effective::FormBuilderInputs::EffectiveCkeditorTextArea

Inherits:
Effective::FormBuilderInput show all
Defined in:
app/models/effective/form_builder_inputs/effective_ckeditor_text_area.rb

Instance Method Summary collapse

Methods inherited from Effective::FormBuilderInput

#field_name, #html_options, #initialize, #js_options, #options, #value

Constructor Details

This class inherits a constructor from Effective::FormBuilderInput

Instance Method Details

#default_input_htmlObject



27
28
29
# File 'app/models/effective/form_builder_inputs/effective_ckeditor_text_area.rb', line 27

def default_input_html
	{class: 'effective_ckeditor_text_area text'}
end

#default_input_jsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/effective/form_builder_inputs/effective_ckeditor_text_area.rb', line 6

def default_input_js
	{
		effective_assets: defined?(EffectiveAssets).present?,
		effective_ckeditor_js_path: asset_path('effective_ckeditor.js'),
		effective_ckeditor_css_path: asset_path('effective_ckeditor.css'),
		contentsCss: (
			case options[:contentsCss]
			when :bootstrap
				'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'
			when false
				nil
			else
				options[:contentsCss] || asset_path('application.css')
			end
		),
		toolbar: options[:toolbar],
		height: options[:height],
		width: options[:width]
	}.compact
end

#to_htmlObject



31
32
33
# File 'app/models/effective/form_builder_inputs/effective_ckeditor_text_area.rb', line 31

def to_html
	text_area_tag(field_name, value, tag_options)
end