Commit d7f572b

Tyler Mercier <tylermercier@gmail.com>
2013-06-17 21:40:19
add some caching samples. remove author
1 parent bfcc3e1
Changed files (3)
app/views/cakes/index.html.erb
@@ -7,7 +7,6 @@
           <a href="<%= url_for cake %>"><%= image_tag cake.photo.url(:thumb), alt: cake.name %></a>
           <div class="caption">
             <h3><a href="<%= url_for cake %>"><%= cake.name %></a></h3>
-            <p><small>by <%= cake.user.email rescue 'N/A' %></small></p>
             <p><span><i class="icon-tags"></i></span> <%= cake.category.name rescue 'N/A' %></p>
             <p><a class="btn" href="<%= url_for cake %>">View</a></p>
           </div>
samples/caching/action_caching.rb
samples/caching/page_caching.rb
@@ -0,0 +1,16 @@
+class PostsController
+  caches_page :index
+
+  def index
+    @posts = Post.all
+  end
+end
+
+class PostsController
+  ...
+  def clear
+    expire_page :action => :index
+  end
+end
+
+Rails.cache.clear