= simple_fields_for @invoice do |invoice|
  = invoice.fields_for :line_items, @line_item, :child_index => -(DateTime.now.to_i) do |line_item|
    = render "#{line_item.object.class.name.underscore.pluralize}/form", :line_item => line_item

= simple_fields_for @invoice do |invoice|
  = invoice.fields_for :line_items, @line_item, :child_index => -(DateTime.now.to_i), wrapper: :inline do |line_item|
    = render "#{line_item.object.class.name.underscore.pluralize}/form", :line_item => line_item

Use inline form when adding a line item via AJAX
Use inline form when adding a line item via AJAX
