[Solved] Rails: Form fields & Loops
[ad_1] Rails has a built in mechanism for handling nested forms. Lets say you have: class Company < ActiveRecord::Base has_many :brands accepts_nested_attributes_for :brands end class Brand < ActiveRecord::Base belongs_to :company end class CompaniesController < ApplicationController def new @company = Company.new @company.brands.new # seeds the form with a new record for brands end def edit @company … Read more