Top "Has-many" questions

has_many indicates a master-detail relationship.

Nested attributes for belongs_to association rails

I have two models, Complaint and Company. Complaint belongs_to and accepts_nested_attributes for Company, and Company has_many …

forms ruby-on-rails-3.2 has-many belongs-to rails-models
Rails, Deleting Children without Deleting Parent using :has_many

I have class MyContainer < ActiveRecord::Base :has_many MyObjects, :dependent => :destroy end I want to delete all the …

ruby-on-rails children has-many
Rails has_many through aliasing with source and source_type for multiple types

So here is a sample class class Company < ActiveRecord::Base has_many :investments has_many :vc_firms, through: :investments, …

ruby-on-rails activerecord associations has-many-through has-many
Rails 3 -- Pass user.id in hidden form field vs using association

Ok so currently I have a form <div class="field"> <%= f.label :title %><br/> &…

ruby-on-rails ruby-on-rails-3 forms associations has-many
ruby on rails - how to make relationship works in route, controller, view ? has_many, belongs_to

I am struggling to get my relationship in rails to work. I have a User,Gallery,Comment model class Gallery …

ruby-on-rails associations relationship has-many belongs-to
rails model has_many of itself

I have a event model. Events can have parent events, set from a column in the model (parent_event_id). …

ruby-on-rails activerecord model has-many
Rails has many and belongs to one

I have a User model which has many projects and a Project model which can have many users, but also …

ruby-on-rails associations has-many has-many-through belongs-to
Rails 3 has_many changed?

I need to track changes (additions and deletes) of an association set up like this: has_many :listing_services has_…

ruby-on-rails ruby ruby-on-rails-3 activerecord has-many
When are Active Record objects in has_many relationships saved?

I'm using Rails 1.2.3 (yeah, I know) and am confused about how has_many works with respect to object persistence. For …

ruby-on-rails activerecord has-many object-persistence
ExtJS 4: Understanding hasMany and belongsTo

I've been struggling to understand how to use hasMany and belongsTo for quite sometime. My understanding is hasMany is a 1:…

model extjs4 has-many extjs4.2 belongs-to