Class: Administrate::Field::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/administrate/field/number.rb

Instance Attribute Summary

Attributes inherited from Base

#attribute, #data, #options, #page, #resource

Instance Method Summary collapse

Methods inherited from Base

associative?, eager_load?, field_type, html_class, #html_class, #html_controller, #initialize, #name, permitted_attribute, #read_value, #required?, searchable?, #to_partial_path, with_options

Constructor Details

This class inherits a constructor from Administrate::Field::Base

Instance Method Details

#to_sObject



7
8
9
10
11
# File 'lib/administrate/field/number.rb', line 7

def to_s
  result = data.nil? ? "-" : format_string % value
  result = format(result) if options[:format]
  prefix + result + suffix
end