0

I have a problem with Rails and Ajax (I'm a beginner).

I have a very large form, and inside this form I have some buttons.

I need to attach an ajax call on these buttons: when i click I need to pass some parameters to the controller and I must then save this parameters in my model.

I create the route and the controller method, but my script doesn't recognize the rails route path.

$("#crop_square").click (e) ->
    $.ajax
      url: save_crop_data_admin_article_path
      type: "POST"
      data: "test"
      success: (data, textStatus, jqXHR) ->


      error: (jqXHR, textStatus, errorThrown) ->


    #if fails      
    e.preventDefault()
Roberto Pezzali
  • 2,484
  • 2
  • 27
  • 56

0 Answers0