5 Surprising ways to use Rails console

While running on Rails, there’s been hardly a day when you don’t pull up rails console. Having basic mode and usage is fine but to spice up things a little bit I would like to share some tricks in this regard.

View Tables

Just run this comm…


This content originally appeared on DEV Community and was authored by Moiz Ali

While running on Rails, there's been hardly a day when you don't pull up rails console. Having basic mode and usage is fine but to spice up things a little bit I would like to share some tricks in this regard.

View Tables

Just run this command and get a glimpse of tables

Image description

Sandbox Mode

You can enable sandbox mode, so that commands are rolled back once you exit

Image description

Make HTTP Requests

Being lazy to hit a route through chrome or any other browser, just play with app object's methods!

Image description

Locate Method Source

Its a kindof search feature that a code editor also offers, but helpful one for the rubyists

Image description

Block Returned Output

If you're annoyed from the return value by iterators and other structures, this will let you cool down!

Image description

Does it worth time saving?. Let me know inside comments.
Make sure to Love and follow @moiz1524


This content originally appeared on DEV Community and was authored by Moiz Ali


Print Share Comment Cite Upload Translate Updates
APA

Moiz Ali | Sciencx (2022-05-07T20:06:18+00:00) 5 Surprising ways to use Rails console. Retrieved from https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/

MLA
" » 5 Surprising ways to use Rails console." Moiz Ali | Sciencx - Saturday May 7, 2022, https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/
HARVARD
Moiz Ali | Sciencx Saturday May 7, 2022 » 5 Surprising ways to use Rails console., viewed ,<https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/>
VANCOUVER
Moiz Ali | Sciencx - » 5 Surprising ways to use Rails console. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/
CHICAGO
" » 5 Surprising ways to use Rails console." Moiz Ali | Sciencx - Accessed . https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/
IEEE
" » 5 Surprising ways to use Rails console." Moiz Ali | Sciencx [Online]. Available: https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/. [Accessed: ]
rf:citation
» 5 Surprising ways to use Rails console | Moiz Ali | Sciencx | https://www.scien.cx/2022/05/07/5-surprising-ways-to-use-rails-console/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.