diff options
| -rw-r--r-- | app/models/page.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index 00832bd..37b221e 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -62,15 +62,17 @@ class Page < ActiveRecord::Base | |||
| 62 | 62 | ||
| 63 | options = defaults.merge options | 63 | options = defaults.merge options |
| 64 | 64 | ||
| 65 | Page.heads.find_tagged_with( | 65 | Page.heads.paginate( |
| 66 | options[:tags].gsub(/\s/, ", "), | 66 | find_options_for_find_tagged_with( |
| 67 | :match_all => true, | 67 | options[:tags].gsub(/\s/, ","), :match_all => true |
| 68 | :order => "#{options[:order_by]} #{options[:order_direction]}" | 68 | ).merge( |
| 69 | ).paginate(:page=>page, :per_page => options[:limit]) | 69 | :page => page, |
| 70 | 70 | :per_page => options[:limit], | |
| 71 | :order => "#{options[:order_by]} #{options[:order_direction]}" | ||
| 72 | ) | ||
| 73 | ) | ||
| 71 | end | 74 | end |
| 72 | 75 | ||
| 73 | |||
| 74 | def self.custom_templates | 76 | def self.custom_templates |
| 75 | files = Dir.entries(FULL_PUBLIC_TEMPLATE_PATH).select do |x| | 77 | files = Dir.entries(FULL_PUBLIC_TEMPLATE_PATH).select do |x| |
| 76 | x if x.gsub!(".html.erb", "") | 78 | x if x.gsub!(".html.erb", "") |
