Module: ActiveScaffold::Bridges::TinyMce::Helpers::FormColumnHelpers
- Defined in:
- lib/active_scaffold/bridges/tiny_mce/helpers.rb
Instance Method Summary collapse
-
#active_scaffold_input_text_editor(column, options) ⇒ Object
(also: #active_scaffold_input_tinymce)
The two column options that can be set specifically for the text_editor input is :tinymce, which overrides single values in the tinymce config.
Instance Method Details
#active_scaffold_input_text_editor(column, options) ⇒ Object Also known as: active_scaffold_input_tinymce
The two column options that can be set specifically for the text_editor input is :tinymce, which overrides single values in the tinymce config. E.g. column.options = ‘other’ will change the theme but not the plugins, toolbars etc. The other one is :tinymce_config, which selects the config to use from tinymce.yml. See the tinymce-rails gem documentation for usage.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/active_scaffold/bridges/tiny_mce/helpers.rb', line 17 def active_scaffold_input_text_editor(column, ) [:class] = "#{[:class]} mceEditor #{column.[:class]}".strip settings = tinymce_configuration(column.[:tinymce_config] || :default). .reject { |k, _v| k == 'selector' } .merge(column.[:tinymce] || {}) ['data-tinymce'] = settings.to_json if ActiveScaffold.js_framework != :prototype html = [] html << send(override_input(:textarea), column, ) if ActiveScaffold.js_framework == :prototype && (request.xhr? || params[:iframe]) html << javascript_tag("tinyMCE.settings = #{settings.to_json}; tinyMCE.execCommand('mceAddEditor', false, '#{[:id]}');") end safe_join html end |