How do I create a form for "has_and_belongs_to_many" association?

git://github.com/vincentopensourcetaiwan/vocabulary.git
This is my source codes.

I got two models, Book and Word.

class Book < ActiveRecord::Base
attr_accessible :description, :name
has_and_belongs_to_many :words
end

class Word < ActiveRecord::Base
attr_accessible :name
end

I got a Join Tables for has_and_belongs_to_many Associations

class CreateBooksWords < ActiveRecord::Migration
def change
create_table :books_words, :id => false do |t|
t.references :book
t.references :word

  t.timestamps
end
add_index :books_words, :book_id
add_index :books_words, :word_id

end
end

How do I create a form for users to insert words into a book?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs