/To_Do_List

A rails application that organizes a to-do list

Primary LanguageRuby

To Do List

The goal of this exercise is to manage your TODOs without full page refreshes by using Vue. No specific instructions, just guidelines based on what you've already done.

// Get collection of "things" from server
var self = this

$.ajax({
  method: "GET",
  url: "/api/things"
}).then(function (data) {
  console.log("promise: ", data) 
})
// Create new "thing"
var self = this

$.ajax({
  method: "POST",
  url: "/api/things"
  data: self.newThing
}).then(function (data) {
  self.newThing = {}
  self.things.push(data)
  console.log("promise: ", data) 
})
// Save existing object "thing" to server

methods: {

  someHandler: function (thing) {

    var self = this

    $.ajax({
      method: "PATCH",
      url: "/api/things/" + self.thing.id,
      data: self.thing
    }).then(function (data) {
      console.log("promise: ", data) 
    })
  }
}