Created
October 27, 2009 14:40
-
-
Save mattscilipoti/219602 to your computer and use it in GitHub Desktop.
.irbrc RailsHelper
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
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