Permalink
Browse files

Eep, committing a mix of a few things here :( ...

- Switch to jquery-rails
- Start implementing a new-quote box idea thingie using Jquery
- Switch to kaminari for pagination instead of will_paginate (works better with rails 3)
  • Loading branch information...
1 parent fba436b commit 8677907f60601ecbe7e5c94920fcab74cb123ba3 @relrod committed May 27, 2011
View
@@ -6,7 +6,7 @@ gem 'rails', '3.0.7'
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
-gem 'will_paginate'
+gem 'kaminari'
# Use unicorn as the web server
# gem 'unicorn'
@@ -24,6 +24,8 @@ gem 'will_paginate'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
+gem 'jquery-rails'
+
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
View
@@ -33,6 +33,11 @@ GEM
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
+ jquery-rails (1.0.7)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ kaminari (0.12.4)
+ rails (>= 3.0.0)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
@@ -64,12 +69,12 @@ GEM
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.27)
- will_paginate (3.0.pre2)
PLATFORMS
ruby
DEPENDENCIES
+ jquery-rails
+ kaminari
rails (= 3.0.7)
sqlite3
- will_paginate
@@ -5,7 +5,8 @@ class QuotesController < ApplicationController
# GET /quotes.xml
def index
@quote = Quote.new
- @quotes = Quote.paginate :page => params[:page], :include => :votes, :order => 'created_at DESC'
+ # @quotes = Quote.paginate :page => params[:page], :include => :votes, :order => 'created_at DESC'
+ @quotes = Quote.order('created_at DESC').page(params[:page]).per(10)
respond_to do |format|
format.html # index.html.erb
@@ -9,8 +9,22 @@
<div class="main">
</div>
</div>-->
+
+<script>
+ $(document).ready(function(){
+ $(".foobar").hide();
+ $("a.haithar").click(function ( event ) {
+ event.preventDefault();
+ $(this).hide();
+ $(".foobar").show();
+ });
+ });
+</script>
+
+<!--<a href='#' class='haithar'>New Quote (will eventually place a quote box here)</a>
+<div class="foobar" style="background-color: red; height: 20px; width: 20px;">hi</div>-->
<% @quotes.each do |quote| %>
-
+
<div class="quote">
<div class="header">
<div class="alleft">
@@ -40,8 +54,7 @@
<div class="box">
<%= render 'form' %>
</div>
-
- <%= page_entries_info @quotes %>
- <%= will_paginate @quotes %>
-->
+ <%= paginate @quotes %>
+
</div>
Oops, something went wrong.

0 comments on commit 8677907

Please sign in to comment.