diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 30556bfc619863c4e24cc1c70624efcff037fc46..092b04f9217982dea8529b5c0c0e051b32a94bf1 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -41,6 +41,7 @@ class PhotosController < ApplicationController end def create + raise "THAT IS NOT OKAY" rescuing_photo_errors do |p| if remotipart_submitted? @photo = current_user.build_post(:photo, params[:photo]) diff --git a/app/views/posts/new.html.haml b/app/views/posts/new.html.haml index a20a287a24b03b6c48b7ca87ec401dfd068d35cb..0279b94e8ecd8591ed410c02c2fc3f4e210ec64c 100644 --- a/app/views/posts/new.html.haml +++ b/app/views/posts/new.html.haml @@ -4,12 +4,15 @@ = f.submit :javascript + // ugly hax to take us from remotipart land to normal backbone land $(function(){ - console.log($('#new_photo')) - $('#new_photo').bind('ajax:success', function(event, data) { - alert("happy day") - console.log(data) - console.log(new Backbone.Model(data)); // Your newly created Backbone.js model - + $('#new_photo').bind('ajax:complete', function(evt, xhr) { + resp = JSON.parse(xhr.responseText) + if(resp.success) { + console.log("response was successful"); + } else { + console.log(resp.error); + }; }); + //console.log(new Backbone.Model(data)); // Your newly created Backbone.js model }); \ No newline at end of file