From 3af611abb212052351f0979b85027adafce87a69 Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 1 Dec 2009 23:02:39 +0100 Subject: dramatically reduced instanciated AR objects for tags --- app/controllers/tags_controller.rb | 13 +++++++------ app/views/custom/partials/_no_date_and_author.html.erb | 4 ++++ app/views/tags/show.html.erb | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 app/views/custom/partials/_no_date_and_author.html.erb diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index c965443..d235601 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -11,12 +11,13 @@ class TagsController < ApplicationController tag_name = @tag ? @tag.name : nil @page = Page.new - @pages = Page.heads.find_tagged_with( - tag_name, :order => 'published_at DESC' - ).paginate( - :page=>params[:page], - :per_page => 23 - ) + @pages = Page.heads.paginate( + Page.find_options_for_find_tagged_with(tag_name).merge( + :order => 'published_at DESC', + :page=>params[:page], + :per_page => 23 + ) + ) end end diff --git a/app/views/custom/partials/_no_date_and_author.html.erb b/app/views/custom/partials/_no_date_and_author.html.erb new file mode 100644 index 0000000..61d6aac --- /dev/null +++ b/app/views/custom/partials/_no_date_and_author.html.erb @@ -0,0 +1,4 @@ +
+

<%= link_to page.title, content_path(page.node.unique_path) %>

+

<%= page.abstract %>

+
\ No newline at end of file diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb index 7016efc..b09cc15 100644 --- a/app/views/tags/show.html.erb +++ b/app/views/tags/show.html.erb @@ -2,7 +2,7 @@ <%= render( - :partial => 'custom/partials/article', + :partial => 'custom/partials/no_date_and_author', :collection => @pages, :as => :page ) -- cgit v1.3