Reputation: 89373
What do I have to do so that this will work in the console (assuming song
is defined, obviously):
edit_song(:id => song.id)
Upvotes: 35
Views: 14433
Reputation: 4127
The following imports named helpers for me in 3.2.8:
> include Rails.application.routes.url_helpers
Upvotes: 16
Reputation: 22016
> script/console
song = Song.first
edit_song_path(:id=>song.id)
assumes (routes.rb)
map.resources :songs
Upvotes: 1
Reputation: 25794
You have access to an app
object which you can use to test routes on.
>> app.root_url
=> "http://www.example.com/"
>> app.root_path
=> "/"
Upvotes: 75