Browse files

paginate homepage features

  • Loading branch information...
2 parents 08bd336 + 57ef516 commit d4bcf36bc68b1dc65c230b7d25cc95f15d8c39f3 @bborn committed Dec 1, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/controllers/homepage_features_controller.rb
View
8 app/controllers/homepage_features_controller.rb
@@ -8,8 +8,12 @@ class HomepageFeaturesController < BaseController
# GET /homepage_features
# GET /homepage_features.xml
def index
- @homepage_features = HomepageFeature.find(:all, :conditions => ["parent_id IS NULL"], :order => "created_at desc")
-
+
+ @search = HomepageFeature.search(params[:search])
+ @search.order ||= :descend_by_created_at
+
+ @homepage_features = @search.find(:all, :conditions => ["parent_id IS NULL"], :page => {:current => params[:page], :size => 100})
+
respond_to do |format|
format.html # index.rhtml
end

0 comments on commit d4bcf36

Please sign in to comment.