Exception: Granite::Form::TypecasterMissing

Inherits:
NoMethodError
  • Object
show all
Defined in:
lib/granite/form/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(*classes) ⇒ TypecasterMissing

Returns a new instance of TypecasterMissing.



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/granite/form/errors.rb', line 70

def initialize(*classes)
  classes = classes.flatten
  super(<<~MESSAGE)
    Could not find typecaster for #{classes}
    You can define it with:

      Granite::Form.typecaster('#{classes.first}') do |value|
        # do some staff with value and options
      end
  MESSAGE
end