. . .

has_many

June 14, 2015

Using has_many with Nested Form in Rails 4

This post shows how to use field_for and accepts_nested_attributes_for to created nested form for has_many model Let suppose the following scenario. We have multiple projects and each project can have multiple screenshots. Following will be the definition of model classes. class Project < ActiveRecord::Base has_many :screenshots end class Screenshot < ActiveRecord::Base […]