jeudi 23 avril 2015

Simple_form_for not using AJAX?

I got a weird problem with my form:

= simple_form_for([@item, @item_comment], :remote => true, id: "new_item_comment", :url => item_item_comments_path(@item)) do |f|
  = f.input :comment, :label => false
  = f.submit "Save", :class => "btn_save left"

Which in my opinion should call:

Started POST "/de-de/contracts/20150423/item_comments" for 127.0.0.1 at 2015-04-23 12:29:33 +0200
Processing by ItemCommentsController#create as JSON

but instead I get it as HTML:

Started POST "/de-de/items/20150423/item_comments" for 127.0.0.1 at 2015-04-23 12:29:33 +0200
Processing by ItemCommentsController#create as HTML

It used to work but without changing these parts, it only uses HTML.

Does anyone have an idea on how to solve this?

Aucun commentaire:

Enregistrer un commentaire