Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Your favorite URL-shortening service in all of Ruby land
Homepage: http://rubyurl.com
Clone URL: git://github.com/robbyrussell/rubyurl.git
Search Repo:
rubyurl / app / controllers / application.rb
100644 14 lines (11 sloc) 0.492 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
 
class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_rubyurl_2.0_session_id'
  
  before_filter :calculate_links
  
  # refactor to some sort of cache tool
  def calculate_links
    @cached_data = {:link_count => Link.count}
  end
end