Table: RailsNotes
User: dreamable
Created at: 2021-02-05 10:35:33 UTC
Updated at: 2021-02-05 23:11:03 UTC
Reference:(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) {}
  })
Tag: