Displaying 1 result from an estimated 1 matches for "createmanufacturers".
2007 May 19
3
form question
...:manufacturer
validates_association :manufacturer
end
class CreateCars < ActiveRecord::Migration
def self.up
create_table cars do |t|
t.column :name, :string
t.column :manufacturer_id, :integer
end
end
class Manufacturer < ActiveRecord::Base
has_many :cars
end
class CreateManufacturers < ActiveRecord::Migration
def self.up
create_table maufacturers do |t|
t.column :name, :string
end
end
Now, I need a form to create new Cars that has two text fields: name,
and manufacturer. I can''t use a select for manufacturer, because there
are far too many of them (...