Permalink
Browse files

Modified the pagenation for time_balances to use ajax for no real reason

  • Loading branch information...
1 parent a6d8bcb commit 6b101a5ad5a684d5c0dde0fdc13b745f1a556155 @zombieCraig zombieCraig committed Aug 23, 2011
@@ -1,3 +1,7 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
+
+jQuery.ajaxSetup({
+ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
+})
@@ -12,6 +12,7 @@ def index
respond_to do |format|
format.html # index.html.erb
+ format.js
format.json { render :json => @time_balances }
end
end
@@ -3,6 +3,7 @@
<head>
<title>MajorLazer</title>
<%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
@@ -23,7 +23,7 @@
<% end %>
</table>
-<%= paginate @time_balances %>
+<%= paginate @time_balances, :remote => true %>
<br />
@@ -0,0 +1,3 @@
++$('#time_balances').html('<%= escape_javascript render(@time_balances) %>');
+ 2
++$('#paginator').html('<%= escape_javascript(paginate(@time_balances, :remote => true).to_s) %>');

0 comments on commit 6b101a5

Please sign in to comment.