Sha256: 388f3c7f5f6878ebda5d7d08e8e9464fd5cdf07830223f4085aef565d6eda511

Contents?: true

Size: 1.59 KB

Versions: 4

Compression:

Stored size: 1.59 KB

Contents

require 'rails_admin/config/fields/base'

module RailsAdmin
  module Config
    module Fields
      module Types
        class Text < RailsAdmin::Config::Fields::Base
          # Register field type for the type loader
          RailsAdmin::Config::Fields::Types.register(self)

          [:ckeditor, :ckeditor_base_location, :ckeditor_config_js, :ckeditor_location].each do |key|
            register_deprecated_instance_option key do
              fail("The 'field(:foo){ ckeditor true }' style DSL is deprecated. Please use 'field :foo, :ck_editor' instead.")
            end
          end

          [:codemirror, :codemirror_assets, :codemirror_config, :codemirror_css_location, :codemirror_js_location].each do |key|
            register_deprecated_instance_option key do
              fail("The 'field(:foo){ codemirror true }' style DSL is deprecated. Please use 'field :foo, :code_mirror' instead.")
            end
          end

          [:bootstrap_wysihtml5, :bootstrap_wysihtml5_config_options, :bootstrap_wysihtml5_css_location, :bootstrap_wysihtml5_js_location].each do |key|
            register_deprecated_instance_option key do
              fail("The 'field(:foo){ bootstrap_wysihtml5 true }' style DSL is deprecated. Please use 'field :foo, :wysihtml5' instead.")
            end
          end

          register_instance_option :html_attributes do
            {
              required: required?,
              cols: '48',
              rows: '3',
            }
          end

          register_instance_option :partial do
            :form_text
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rails_admin-1.0.0.rc lib/rails_admin/config/fields/types/text.rb
rails_admin-0.8.1 lib/rails_admin/config/fields/types/text.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/lib/rails_admin/config/fields/types/text.rb
rails_admin-0.7.0 lib/rails_admin/config/fields/types/text.rb