Exception: Id::MissingAttributeError
- Inherits:
-
StandardError
- Object
- StandardError
- Id::MissingAttributeError
- Defined in:
- lib/id/field.rb
Instance Method Summary collapse
-
#initialize(model, field) ⇒ MissingAttributeError
constructor
A new instance of MissingAttributeError.
Constructor Details
#initialize(model, field) ⇒ MissingAttributeError
Returns a new instance of MissingAttributeError.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/id/field.rb', line 38 def initialize((model, field)) super "#{model.class.name} had a nil value for '#{field.name}'.\n\n" + "*** Field information ***\n#{field.to_s}\n\n" + "*** Model data ***\n#{model.data.inspect}\n\n" + "If you're trying to use an Id::Model in a Rails form, make sure:\n" + "* You 'include Id::Form' in your model\n" + "* You have the following line in your 'config/application.rb': \n\n" + " config.action_view.default_form_builder = Id::FormBuilder\n\n" end |