Skip to content

Instantly share code, notes, and snippets.

@svenfuchs
Created January 29, 2009 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svenfuchs/54542 to your computer and use it in GitHub Desktop.
Save svenfuchs/54542 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.from_plugins
map.filter 'force_html'
end
ActionController::Dispatcher.to_prepare do
require 'application' # need to do this so we can access BaseController
BaseController.class_eval do
include UrlHistory::Tracking
tracks_url_history
end
Content.class_eval do
def update_url_history_params(params)
if params.has_key?(:year)
params.merge self.full_permalink
elsif params.has_key?(:permalink)
params.merge :permalink => self.permalink
else
params
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment