Sha256: 0898079a154932548d447079193440245b8050af647eb6fec503c6bbdbac48b8

Contents?: true

Size: 845 Bytes

Versions: 12

Compression:

Stored size: 845 Bytes

Contents

module Ckeditor
  module Hooks
    module SimpleFormBuilder
      class CkeditorInput < ::SimpleForm::Inputs::Base
        def input
          @builder.send(:cktext_area, attribute_name, input_html_options)
        end
      end
      
      def self.included(base)
        base.send(:include, InstanceMethods)
      end
    
      module InstanceMethods
        def ckeditor(attribute_name, options={}, &block)
          column     = find_attribute_column(attribute_name)
          input_type = default_input_type(attribute_name, column, options)

          if block_given?
            SimpleForm::Inputs::BlockInput.new(self, attribute_name, column, input_type, options, &block).render
          else
            CkeditorInput.new(self, attribute_name, column, input_type, options).render
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ckeditor-3.7.0.rc3 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.7.0.rc2 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.7.0.rc1 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.6.3 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.6.2 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.6.1 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.6.0 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.6.0.pre lib/ckeditor/hooks/simple_form.rb
ckeditor-3.5.4 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.5.3 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.5.2 lib/ckeditor/hooks/simple_form.rb
ckeditor-3.5.1 lib/ckeditor/hooks/simple_form.rb