aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/refinery
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/refinery')
-rw-r--r--app/controllers/refinery/blog/posts_controller.rb15
-rw-r--r--app/controllers/refinery/blog_controller.rb2
2 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb
index bdf53f0..f055797 100644
--- a/app/controllers/refinery/blog/posts_controller.rb
+++ b/app/controllers/refinery/blog/posts_controller.rb
@@ -73,10 +73,9 @@ module Refinery
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
- @blog_posts = Refinery::BlogPost.tagged_with(@tag_name).paginate({
- :page => params[:page],
- :per_page => Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
- })
+ @blog_posts = Refinery::BlogPost.tagged_with(@tag_name)
+ .page(params[:page])
+ .per(Refinery::Setting.find_or_set(:blog_posts_per_page, 10))
end
protected
@@ -92,10 +91,10 @@ module Refinery
end
def find_all_blog_posts
- @blog_posts = Refinery::BlogPost.live.includes(:comments, :categories).paginate({
- :page => params[:page],
- :per_page => Refinery::Setting.find_or_set(:blog_posts_per_page, 10)
- })
+ @blog_posts = Refinery::BlogPost.live
+ .includes(:comments, :categories)
+ .page(params[:page])
+ .per(Refinery::Setting.find_or_set(:blog_posts_per_page, 10))
end
def find_tags
diff --git a/app/controllers/refinery/blog_controller.rb b/app/controllers/refinery/blog_controller.rb
index 6bec0a5..cbafdeb 100644
--- a/app/controllers/refinery/blog_controller.rb
+++ b/app/controllers/refinery/blog_controller.rb
@@ -1,7 +1,7 @@
module Refinery
class BlogController < ::ApplicationController
- helper :blog_posts
+ helper :'refinery/blog_posts'
before_filter :find_page, :find_all_blog_categories
protected