表单: RailsNotes
用户: dreamable
创建日期: 2021-02-05 10:35:33 UTC
更新日期: 2021-02-05 23:11:03 UTC
引用:(Table ID 3, Record ID 19)

标题 :
Rails JavaScript
笔记 :

Working with JavaScript in Rails

How to Use AJAX With Ruby on Rails

  • Client make a AJAX request
  // JS style
  $.get( "/vegetables", function(data) {
    alert("Vegetables are good for you!");
  });
  // Rails style
  Rails.ajax({
    url: "/books",
    type: "get",
    data: "",
    success: function(data) {},
    error: function(data) {}
  })
标签: