I'm using this good answer:
https://stackoverflow.com/a/16920211/4412054
in my project:
_form.html.erb:
= form_tag({controller: "users", action: "create"}, remote: true) do
  %table
    %tr
      %td= text_field_tag 'user[][first_name]'
      %td= text_field_tag 'user[][last_name]'
    %tr.actions
      %td= submit_tag 'Save'
      %td= button_tag 'Add new user form', id: 'add_user_form'
    %tr.new_user_row.hidden # hidden class matches the css rule: {display:none;}
      %td= text_field_tag "user[][first_name]"
      %td= text_field_tag "user[][last_name]"
:javascript # jQuery
  $('#add_user_form').bind('click', function(e) {
    var row = $('tr.new_user_row').clone().removeClass('hidden new_user_row');
    $('tr.actions').before(row); # will append the <tr> before the actions
  });
and UsersController:
def create
  params[:user].each do |attr|
    User.create(attr)
  end
end
but when I submit it give me this error:
ActiveModel::ForbiddenAttributesError
If I disable Rails 4 strong_parameters by config.action_controller.permit_all_parameters = true in config/application.rb it works and save.
How to permit the hash
..., "user"=>[{"first_name"=>"Name", "last_name"=>"Last"}, {"first_name"=>"", "last_name"=>""}],....
in my controller?
UPDATE
If I use in Rails console:
User.create({"first_name"=>"Name", "last_name"=>"Last"})
it works!!!
UPDATE 2
In my controller I have this:
def users_params
  params.require(:user).permit(:user, array: [:first_name, :last_name])
end
 
    