I am using simple_form as my form builder in a rails project, with RethinkDB as the database and the NoBrainer ORM. I have set up the models to include the relationships between them however when trying to generate the select dropdown for the association, I get the error Association :currency not found. Where am I going wrong?
class Country
include NoBrainer::Document
belongs_to :currency
field :name, type: String
field :nationality, type: String
end
class Currency
include NoBrainer::Document
has_many :countries
field :name, type: String
field :code, type: String
field :symbol, type: String
end
= simple_form_for @country do |f|
= f.input :name, placeholder: 'e.g. Namibia', label: 'Country'
= f.input :nationality, placeholder: 'e.g. Namibian', label: 'Nationality'
= f.association :currency, placeholder: 'Please select one', label: 'Currency', label_method: :code
= f.button :submit