Sha256: c503d61ba22222ebe6172c23459e2c1d170dfa38ecf6cd5019cf16ca5d4dca2a

Contents?: true

Size: 683 Bytes

Versions: 25

Compression:

Stored size: 683 Bytes

Contents

#require 'rails_admin/config/fields/base'
module RailsAdmin::Config::Fields::Types
  class Ckeditor < RailsAdmin::Config::Fields::Types::Text
    RailsAdmin::Config::Fields::Types::register(:ckeditor, self)
        
    register_instance_option(:config) do
      {}
    end
    
    register_instance_option(:partial) do
      :form_ckeditor
    end

    def scope_type

      # Use association name if existent
      if bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).nil?
        bindings[:form].object_name
      else
        bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).to_s
      end
    end

    def scope_id
      bindings[:object].id
    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
glebtv-ckeditor-4.3.2.2 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.3.2.1 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.3.2.0 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1.5 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1.4 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1.3 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1.2 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1.1 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.2.1 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.7 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.6 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.5 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.4 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.3 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.2 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1.1 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.1.1 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.0.2.7 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.0.2.6 lib/ckeditor/rails_admin/field.rb
glebtv-ckeditor-4.0.2.5 lib/ckeditor/rails_admin/field.rb