Skip to content

Instantly share code, notes, and snippets.

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