I’m just learning Ruby on Rails (no prior Ruby experience)
I have these models (not showing the migrations here for brevity – they’re standard fields like firstname, city etc):
class User < ActiveRecord::Base
has_one :address
end
class Address < ActiveRecord::Base
has_one :user
end
How do I use the Address class to manage the underlying table data? Simply call methods on it? How would I pass params/attribute values to the class in that case? (since Address won’t have a controller for it (since it’s meant to be used internally)).
How does one go about doing something like this?
There is more to it then just this, let me know if you have any questions on stuff I didn’t cover