Created
October 8, 2009 18:51
-
-
Save mattscilipoti/205269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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