Reputation: 52658
When I try to use url_for
in the rails console, I see:
url_for(User.first.images.first)
NoMethodError: undefined method `url_for' for main:Object
How can I use that method in the rails console?
Upvotes: 7
Views: 3198
Reputation: 1059
you can use the following to check route helper methods in the console.
app.url_for(User.first.images.first)
the app would give you a view context. But beware if you are using it in the application.
Upvotes: 15