Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

paginate homepage features

  • Loading branch information...
commit d4bcf36bc68b1dc65c230b7d25cc95f15d8c39f3 2 parents 08bd336 + 57ef516
@bborn authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.