Sha256: a7e31c083d2f12e89bd73e236d6d31e757233b86a4f29d6c2882256e22287f51

Contents?: true

Size: 758 Bytes

Versions: 15

Compression:

Stored size: 758 Bytes

Contents

require 'simple_form'

module Ckeditor::Hooks::SimpleForm
  class CkeditorInput < ::SimpleForm::Inputs::Base
    def input(wrapper_options = nil)
      @builder.cktext_area(attribute_name, input_html_options)
    end
  end
end

::SimpleForm::FormBuilder.map_type :ckeditor, :to => Ckeditor::Hooks::SimpleForm::CkeditorInput

# TODO: remove this after a while, SimpleForm::FormBuilder#ckeditor is deprecated.
class SimpleForm::FormBuilder
  def ckeditor(attribute_name, options={}, &block)
    warn "[DEPRECATION] calling f.ckeditor(:#{attribute_name}, ...) is deprecated, call f.input(:#{attribute_name}, :as => :ckeditor, #{options.to_s[1..-1]}) #{Kernel.caller.first}"
    options[:as] = :ckeditor
    self.input(attribute_name, options, &block)
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
danabr75-ckeditor-4.1.6 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.6.0 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.5.10.3 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.5.10.2 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.5.10.1 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.5.7.1 lib/ckeditor/hooks/simple_form.rb
glebtv-ckeditor-4.5.7 lib/ckeditor/hooks/simple_form.rb
ckeditor_custom_controller-4.1.6 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.6 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.5 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.4 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.3 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.2 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.1 lib/ckeditor/hooks/simple_form.rb
ckeditor-4.1.0 lib/ckeditor/hooks/simple_form.rb