Sha256: 25eade386f8a19f32dd9a38ed191e2382cdff0a8a0310c459548460ffa91cb6d

Contents?: true

Size: 947 Bytes

Versions: 20

Compression:

Stored size: 947 Bytes

Contents

require 'rails_admin/config/fields/types/string'

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

          register_instance_option :view_helper do
            :password_field
          end

          def parse_input(params)
            params[name] = params[name].presence
          end

          register_instance_option :formatted_value do
            ''.html_safe
          end

          # Password field's value does not need to be read
          def value
            ''
          end

          register_instance_option :visible do
            section.is_a?(RailsAdmin::Config::Sections::Edit)
          end

          register_instance_option :pretty_value do
            '*****'
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rails_admin-1.4.2 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.4.1 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.4.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.3.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.2.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.1.1 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.1.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.0.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-1.0.0.rc lib/rails_admin/config/fields/types/password.rb
rails_admin-0.8.1 lib/rails_admin/config/fields/types/password.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/password.rb
rails_admin-0.7.0 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.8 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.7 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.6 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.5 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.4 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.3 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.2 lib/rails_admin/config/fields/types/password.rb
rails_admin-0.6.1 lib/rails_admin/config/fields/types/password.rb