I am having torubles with my model.
I have the code:
class Typeofaid < ActiveRecord::Base
validates_inclusion_of :type, :in => %w(Food Water Health)
end
But whenever I type ‘Food’ etc in the box I get
`1 error prohibited this typeofaid from being saved:
* Type is not included in the list
`
Can anyone help?
I think you have to facturize your model using the type attribute instead of just entering some value using an input box.
“type” is a reserved column for single table inheritence in Rails.