Skip to content

Instantly share code, notes, and snippets.

@mattscilipoti
Created October 8, 2009 18:51
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 mattscilipoti/205269 to your computer and use it in GitHub Desktop.
Save mattscilipoti/205269 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'wirble'
#require 'utility_belt' #didn't play well with others, try again later.
require 'hirb' #nice console formatting
Wirble.init
Wirble.colorize
Hirb.enable
puts "`include RailsHelper` for named_urls, helpers, etc."
module RailsHelper
def self.included(base)
##from: http://kpumuk.info/ruby-on-rails/memo-6-using-named-routes-and-url_for-outside-the-controller-in-ruby-on-rails/
## this is slow because all routes and resources being calculated now
base.send('include', ActionController::UrlWriter)
base.default_url_options[:host] = 'www.example.com'
DatabaseCleaner.strategy = :truncation, {:except => SeedData.seed_tables}
puts "You can now utilize named_urls & DatabaseCleaner.clean"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment