Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. var cards = $('.cards'); // only fetches previous cards, not the new ones
  2.  
  3. my_function( cards );
  4.  
  5. def fetch_cards
  6. respond_to do |format|
  7. format.js
  8. end
  9. end
  10.  
  11. $.ajax('your/resources.json',
  12. complete: function(jqXHR, status){
  13. // this will be executed once the server has completed your request
  14. my_function(cards);
  15. }
  16. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement