     $(form).on 'submit', -> return false
 
     $(target).replaceWith(form)
-
 
 window.remoteSubmit = (target, callback)->
   $(target).data('remote', true)

      parent.trigger 'polymorphic_has_many_add:after', [fieldset, parent]

  init_polymorphic_sortable()


  $('.polymorphic_has_many_container').on 'change', '.polymorphic_type_select', (event) ->
    fieldset = $(this).closest 'fieldset'

    if sortable_input.length
      sortable_input.val if destroy_input.is ':checked' then '' else position++

window.extractAndInsertForm = (url, target)->
  target = $ target

  $.get url, (data)->
