Displaying 3 results from an estimated 3 matches for "manufacturer_id".
Did you mean:
manufacture_id
2006 Jan 22
5
has_one not working as expected?
...---------------+---------------------------------------------------------
id | integer | not null default
nextval(''public.filters_id_seq''::text)
name | character varying(255) | not null
filter_factor | numeric(2,1) | not null
manufacturer_id | integer | not null
description | character varying(50) | not null
Indexes:
"filters_pkey" primary key, btree (id)
Foreign-key constraints:
"$1" FOREIGN KEY (manufacturer_id) REFERENCES manufacturers(id) ON
DELETE CASCADE
The tables contain this t...
2007 May 19
3
form question
...ng models/migrations:
class Car < ActiveRecord::Base
belongs_to :manufacturer
validates_presence_of :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:...
2006 Mar 13
2
newbie: parent-child view
I have a simple database: a list of manufacturers (parent) and the parts
(child) for the manufacturer.
>From scaffold, I have a ?show? view listing manufacturers. I modified
this view to list the parts for the manufacturer. I also have a link to
create a new part. This causes the controller to display a new view to
create a new part for the manufacturer.
So creating the part is AOK,