Up and Running with Minitest I love minitest. Minitest is simple. There’re a few ways to write tests, and they are so intuitive. I learned it last year, when
Ruby Shortcut to Call a Method with Each Array Item as Parameter As a Ruby programmer, you probably know the &: shortcut to call a method on each item in an array. For example, this snippet will
How to Manage Environment Variables in Rails Now you might think it’s so easy to access them using the ENV hash. Why do we need a different way? Well, a very
Useful Linux Commands Learning the Linux command line, like becoming an accomplished pianist, is not something that we pick up in an afternoon. It takes years of practice.
Running a Single Test with Spaces in Minitest In Rails, if you want to run a specific test without the others in the file, you can pass the method’s name to the
How to Convert a Ruby Object to Hash Let’s say you have a Product object with properties @name = "Table" & @price = 10. What’s the best way in Rails to
Useful Ruby Gems Although Rails provides great defaults out-of-the-box, you can easily extend it with Ruby gems. Here are some gems that I find myself using every time
How to Access Route Helpers from Rails Console and Models This post shows a simple way to check the output of URL and path helpers directly from the Rails console. We will also see how to access these helpers in your models.
Why Turbo Uses Event Capturing 💡If you are interested in learning about Hotwire, check out my crash-course on Hotwire's Turbo framework. I was reading the source of the
Why Choose `let` Over instance variables in RSpec Repetitive setup code in tests makes it difficult to refactor the tests. It also distracts and shifts our focus from the business logic that we’
Inline Edits using Turbo Frames This post explains how to use Turbo Frames to make your web application behave like a Single-Page Application without using any JavaScript.
Turbo Drive Essentials 💡If you are interested in learning about Hotwire, check out my crash-course on Hotwire's Turbo framework. I spent the last night reading up