I got two models, Book and Word.

class Book < ActiveRecord::Base
  has_and_belongs_to_many :words
end

class Word < ActiveRecord::Base
   has_and_belongs_to_many :books
end



I got a Join Tables for has_and_belongs_to_many Associations

class CreateBooksWords < ActiveRecord::Migration
  def self.up
    create_table :books_words, :id => false do |t|
      t.integer :book_id
      t.integer :word_id

      t.timestamps
    end
  end

  def self.down
    drop_table :books_words
  end
end



Now I want to create Routing, and user can insert words for a book.
How do I do that?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to