Re: [Rails] Help with habtm

2015-03-24 Thread Colin Law
On 24 March 2015 at 18:50, Gm wrote: > Hi, > > I'm using habtm to create a relationship between two models: > > class Question < ActiveRecord::Base > has_and_belongs_to_many :exams > end > > class Exam < ActiveRecord::Base > has_and_belongs_to_many :questions > end > > At some point I'm doing

[Rails] Help with habtm

2015-03-24 Thread Gm
Hi, I'm using habtm to create a relationship between two models: class Question < ActiveRecord::Base has_and_belongs_to_many :exams end class Exam < ActiveRecord::Base has_and_belongs_to_many :questions end At some point I'm doing this: class Exam < ActiveRecord::Base has_and_belongs_to

[Rails] Help with habtm models in one form

2008-12-04 Thread Fatih Genç
Hi I have a post and a category model class Post < ActiveRecord::Base has_and_belongs_to_many :categories end class Category < ActiveRecord::Base has_and_belongs_to_many :posts end I created join table migration files Now I wanna create category while creating post I mean user can choose category