views:

11

answers:

0

I was able to create nested arrays in my view to post to my 'create' action. But I'm not sure how to save the nested array.

Here's the basic create action where it gets all individual params bunched in mass-assigned params:

def create
  @post = Post.new(params[:mass_assigned])
  respond_to do |format|
    if @post.save
      format.html
    else
      format.html
    end
  end
end

But this returns a nil object error. It's likely due to my form using the check_box_tag rather than using the check_box with comes with nifty magic and causes the :mass_assigned to be nil. I'm fairly new to rails and would appreciate any leads to get this working. Please explain how to format my method to collect the individual params then save it.