diff --git a/config/assets.yml b/config/assets.yml index e26dd7e6..ed14601b 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -3,10 +3,12 @@ embed_assets: on javascripts: bulk_pets_package: + - public/javascripts/ajax_auth.js - public/javascripts/pet_query.js - public/javascripts/pets/bulk.js edit_outfit_package: + - public/javascripts/ajax_auth.js - public/javascripts/jquery.jgrowl.js - public/javascripts/wardrobe.js - public/javascripts/outfits/edit.js diff --git a/public/javascripts/ajax_auth.js b/public/javascripts/ajax_auth.js new file mode 100644 index 00000000..50b7c062 --- /dev/null +++ b/public/javascripts/ajax_auth.js @@ -0,0 +1,9 @@ +(function () { + var csrf_param = $('meta[name=csrf-param]').attr('content'), + csrf_token = $('meta[name=csrf-token]').attr('content'), + data = {}; + + data[csrf_param] = csrf_token; + + $.ajaxSetup({data: data}); +})(); diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index 2a1a0ce1..b6d8009c 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -1,15 +1,3 @@ -(function () { - var csrf_param = $('meta[name=csrf-param]').attr('content'), - csrf_token = $('meta[name=csrf-token]').attr('content'), - data = {}; - - data[csrf_param] = csrf_token; - - $.ajaxSetup({ - data: data - }); -})(); - $.fn.notify = function () { return this.stop(true, true).show('slow').delay(5000).hide('fast'); }