Creating a Multiple Row Form
The View
1 2 <% 10.times do |n| %> 3 <%= text_field_tag "milestones[#{n}][title]" %><br /> 4 <% end %>
The Controller
1 2 def create 3 10.times do |n| 4 next if params[:milestones][n.to_s][:title].blank? 5 Milestone.create(params[:milestones][n.to_s]) 6 end 7 end