Skip to content

Commit

Permalink
JavaScript: Fix authenticity_token problems
Browse files Browse the repository at this point in the history
One of these should be a GET; the other needed a token.
  • Loading branch information
emk committed Dec 26, 2008
1 parent de8bff5 commit 1ea714e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/javascripts/mephisto/application.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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('&')
Expand Down

0 comments on commit 1ea714e

Please sign in to comment.