Created
November 28, 2011 06:25
-
-
Save jem/1399348 to your computer and use it in GitHub Desktop.
include url helpers
This file contains hidden or 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
# To play with routes in the rails console from rails 3.1, use the following: | |
include Rails.application.routes.url_helpers | |
default_url_options[:host] = 'localhost:3000' # or whatever | |
# Now, can freely play with routes. | |
>> url_for User.first | |
=> "http://localhost:3000/users/7" | |
>> url_for [Pod.first, :tasks] | |
=> "http://localhost:3000/pods/8/tasks" | |
# etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is now broken, just use app.url_for