Topic: Creation Form View / Controller

I'm currently new to rails and I'm trying to convert one of my PHP applications to rails and I need some help creating a form for my model.

I have a Patten which has many PattenSpecs which contains 1 color and 1 material.
I create Materials and Colors in the scaffolded forms but I have no clue about how to create a form for the Pattern.
The form should ask for the properties of the Pattern Modell and create several PatternSpecs containing 1 existing color and 1 existing material.

Rel:
Pattern has_many PatternSpecs
PatternSpecs has_one Color
PatternSpecs has_one Material
Color has_many PatternSpecs
Material has_many PatterSpecs

Something like this
http://dl.dropbox.com/u/32242733/patternform.png

Re: Creation Form View / Controller

My models

Pattern
  attr_accessible :name, :text
  has_many :pattern_specs
PatternSpec
  attr_accessible :placement
  belongs_to :pattern
  belongs_to :color
  belongs_to :material 
Material
  attr_accessible : name
  has_many :pattern_specs
Color
  attr_accessible :color
  has_many :pattern_specs

And I want a View and Controller to create a Pattern with n PatternSpecs

Last edited by Artmann (2013-01-24 08:57:52)