18 lines
No EOL
580 B
Text
18 lines
No EOL
580 B
Text
= form_for Photo.new, :html => { :multipart => true }, :remote => true do |f|
|
|
= f.label :user_file
|
|
= f.file_field :user_file
|
|
= f.submit
|
|
|
|
:javascript
|
|
// ugly hax to take us from remotipart land to normal backbone land
|
|
$(function(){
|
|
$('#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
|
|
}); |