Guest User

Untitled

a guest
Jan 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <%=
  2. link_to('refresh', '/mycontroller/index', :remote => true)
  3. %>
  4.  
  5. <div id="mydiv">
  6. <%=
  7. @mydata
  8. %>
  9. </div>
  10.  
  11. $('#mydiv').html('<%= escape_javascript(@mydata) %>')
  12.  
  13. function executeQuery() {
  14. $.ajax({
  15. //url: '/index',
  16. success: function(data) {
  17. $('#mydiv').html(data)
  18. }
  19. });
  20. setTimeout(executeQuery, 500);
  21. }
  22.  
  23. $(document).ready(function() {
  24. setTimeout(executeQuery, 500);
  25. });
  26.  
  27. $('#mydiv').html(data)
  28.  
  29. $('#mydiv').load('/mycontroller/index #mydiv')
  30.  
  31. def action1
  32. <your code here>
  33. end
  34. def action2
  35. <your code here>
  36. render :layout => false
  37. end
Add Comment
Please, Sign In to add comment