Why does link_to 'Back', posts_path
work in ERB but posts_path
doesn't work in the console?
$ rails console
irb(main):005:0> posts_path
NameError: undefined local variable or method `posts_path' for main:Object
You need to add context of app
in console.
app.posts_path
app.get app.posts_path
app.response
app.response.body
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.