Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 7th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class ApplicationController < ActionController::Base
  2.  
  3.   before_filter :fetch_authors_and_categories
  4.  
  5.   #...
  6.  
  7.   private
  8.  
  9.   def fetch_authors_and_categories
  10.     Couch.client(:bucket => 'system').pipelined do
  11.       @authors = Author.popular
  12.       @categories = Category.popular
  13.     end
  14.   end
  15.  
  16.   #...
  17.  
  18. end