Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created November 5, 2010 23:38
Show Gist options
  • Save ahoward/665041 to your computer and use it in GitHub Desktop.
Save ahoward/665041 to your computer and use it in GitHub Desktop.
# support for using named routes from the console
#
# files: lib/railsext.rb
#
module Kernel
private
def use_named_routes_in_the_console! options = {}
include ActionController::UrlWriter
options.to_options!
options.reverse_merge! :host => 'localhost', :port => 3000
default_url_options.reverse_merge!(options)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment