Displaying 1 result from an estimated 1 matches for "customer_rank_id".
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
...don''t understand this:
Rails responds:
ActiveRecord::AssociationTypeMismatch in Admin/customers#create
Rank expected, got String
5. What I have tried
Don''t give up first John, try changing file
app/views/admin/customers/_form.html line #13-14 with:
<p><label for="customer_rank_id">Rank</label><br />
<%= select ''customer'', ''rank_id'', Rank.find_all.collect { |r| [
r.description, r.id ] } %></p>
Then change app/models/customer.rb line #5-6 with these:
validates_presence_of :rank_id
validates_associated :rank...