Skip to content

Commit

Permalink
[docs] Update sample application to use progress callback
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Aug 12, 2014
1 parent 3ecbdbd commit 839f8fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sample/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ ready = function() {
},
fail: function(e, data) {
return alert(data.failReason);
},
progress: function(e, data) {
window.document.title = parseInt(data.loaded / data.total * 100, 10) + '%'
}
});
});
Expand Down
1 change: 1 addition & 0 deletions sample/app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
</div>
<div class="actions">
<%= f.submit %>
<span>(upload big file to show progress in the title bar)</span>
</div>
<% end %>
1 change: 1 addition & 0 deletions sample/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
root to: 'users#index'
resources :users

# The priority is based upon order of creation: first created -> highest priority.
Expand Down

0 comments on commit 839f8fe

Please sign in to comment.