Browse files

JavaScript: Fix authenticity_token problems

One of these should be a GET; the other needed a token.
  • Loading branch information...
1 parent de8bff5 commit 1ea714e42637e08faa76d7c988cf85125207c23f @emk emk committed Dec 26, 2008
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('&')

0 comments on commit 1ea714e

Please sign in to comment.