Develumpen

Access Ruby on Rails path and url helpers in console

If you try to retrieve either a _path or _url from the console you'll see an error. You'll have to call the method from the app.

Loading production environment (Rails 7.1.3.2)
irb(main):001> root_url
(irb):1:in `<main>': undefined local variable or method `root_url' for main:Object (NameError)

root_url
^^^^^^^^
irb(main):002> app.root_url
=> "http://www.example.com/"
#ruby on rails