All threads / Rails Console

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Rails Console

Chris Ma asked in Rails

Hi all,

This might be a retarded question but how do I access things other than Models in rails console, such as Controller methods, engines etc.? I wouldn't mind seeing a video dedicated to console and the extent on what you can look up.

Cheers,
Chris

This page on the rails guide shows more things you can do

http://guides.rubyonrails.org/command_line.html

It looks like you have access to the app and helper methods as well.

What Andrew said! For some of the controller methods, you can sometimes just instantiate the class like any other normal object. The trouble will be that you don't have request objects to work with to pass in.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,399+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.