Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

JavaScript: Fix authenticity_token problems

One of these should be a GET; the other needed a token.
  • Loading branch information...
commit 1ea714e42637e08faa76d7c988cf85125207c23f 1 parent de8bff5
@emk emk authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 public/javascripts/mephisto/application.js
View
5 public/javascripts/mephisto/application.js
@@ -53,7 +53,7 @@ var TinyTab = Class.create();
TinyTab.callbacks ={
'latest-files': function() {
if($('latest-assets').childNodes.length == 0)
- new Ajax.Request(Mephisto.root + '/admin/assets/latest');
+ new Ajax.Request(Mephisto.root + '/admin/assets/latest', {method: 'get'});
},
'search-files': function(q) {
if(!q) return;
@@ -275,7 +275,8 @@ var SectionForm = {
},
saveSortable: function(section_id, container_id) {
- var query = $$('#'+container_id+' li').inject([], function(qu, li) {
+ var token = 'authenticity_token=' + Mephisto.token;
+ var query = $$('#'+container_id+' li').inject([token], function(qu, li) {
qu.push('sorted_ids[]=' + li.getAttribute('id').substr(container_id.length));
return qu;
}).join('&')
Please sign in to comment.
Something went wrong with that request. Please try again.