El 15/07/14 22:20, Quiliro Ordóñez Baca escribió: > I can now see the administative_unit on the employee edit page. But > when I try to save the changes to this, I get no error and at the same > time the administrative_unit does not reflect the change that I made. > These are the contents of the models. > > class AdministrativeUnit < ActiveRecord::Base > > hobo_model # Don't put anything above this > > fields do > name :string > timestamps > end > attr_accessible :name, :employees > has_many :employees, :accessible => true > > > class Employee < ActiveRecord::Base > > hobo_model # Don't put anything above this > > fields do > name :string > timestamps > end > > attr_accessible :name, :administrative_unit > belongs_to :administrative_unit
When I changed:
-attr_accessible :name, :administrative_unit
+attr_accessible :name, :administrative_unit, :administrative_unit_id
I got the error:
unknown attribute: administrative_unit_id
But then I remembered to make a migration because I had changed the
models. It worked!
--
Saludos libres,
Quiliro Ordóñez
600 8579
signature.asc
Description: OpenPGP digital signature
