I wonder if anyone know how I can make these relations work, I'm getting
error on relationship.
Is it because I'm not doing it the rails way?
Is it a MUST to have "layout_id" and "snippet_id" in the join table
(container) ? Cannot I choose the column names like "reference_id" and
class Layout < ActiveRecord::Base
has_many :snippets, :through => :container
class Container < ActiveRecord::Base
belongs_to :layout, :foreign_key => :reference_id
belongs_to :snippets, :foreign_key => :container_id, :class_name =>
class Container::Snippet < ActiveRecord::Base
has_many :layouts, :through => :container
Thanks for help.