Skip to content

Instantly share code, notes, and snippets.

@b-ggs
Created November 8, 2016 11:37
Show Gist options
  • Save b-ggs/d53fa2fc298cb1a9a15e558875a4a0a2 to your computer and use it in GitHub Desktop.
Save b-ggs/d53fa2fc298cb1a9a15e558875a4a0a2 to your computer and use it in GitHub Desktop.
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$.ajax
url: "api/v1/boxes"
dataType: "json"
error: (jqXHR, textStatus, errorThrown) ->
$('.ajax-test').append "AJAX Error: #{textStatus}"
success: (data, textStatus, jqXHR) ->
$('.ajax-test').append "Successful AJAX call: #{JSON.stringify data}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment