Sign up for my newsletter
Let's learn to become better developers.
A Brief Introduction to Hotwire
Hotwire, which stands for HTML Over the Wire, provides a different way to build modern web applications without using too much JavaScript. This article provides a quick introduction to Hotwire and its component frameworks, such as Turbo Drive, Frames, and Streams.
February 18, 2023
How Rails Authenticity Tokens Protect Against CSRF Vulnerability
Rails protects your web application from CSRF attack by including an authenticity token in the HTML forms. This token is also stored in the user's session. Upon receiving a request, Rails compares these two tokens to decide if the request is verified.
February 17, 2023
Cross-Site Request Forgery (CSRF) Attack: What It Is, How It Works, and How to Prevent It
CSRF vulnerability tricks authenticated users of an application to perform a dangerous activity on that application, simply by clicking a link. This post explains how CSRF works with a practical example, and shows how to protect against it, both as a user and a developer building web applications.
February 12, 2023
Docked Rails: Setup a Ruby on Rails Application on Docker 🐳
Setting up a new Ruby on Rails application with all the dependencies doesn't have to be complicated. Docked is a new command line tool that simplifies the process of creating a new Rails app using Docker.
February 07, 2023
The Difference Between load, autoload, require, and require_relative in Ruby 📖
Loading external files can get tricky in Ruby, but it doesn't have to be. This post explains the usage of Ruby's load, require, and require_relative methods, and when to use each.
January 28, 2023
Open GitHub Repositories in VS Code In-Browser
GitHub allows you to open any repository in an in-browser VS Code by just pressing the `.` key on your keyboard.
January 22, 2023
Method Shorthand in Ruby
Ruby (3.0 and up) provides a shorthand syntax for one-line methods, similar to computed properties in C#.
January 19, 2023
How to Explicitly Render a Different View in Rails
This post shows how you can render a different view from a Rails controller. Just use the `render` helper method, pass the name of the view you want to render, and you're done.
January 19, 2023
class_eval vs. instance_eval in Ruby
This post explains the difference between class_eval and instance_eval methods in Ruby. If you keep getting confused between them when reading or writing Ruby code, it should clarify things a little.
January 15, 2023
Array Inquiry in Rails
The ArrayInquirer class provided by the Active Support framework in Rails provides a readable way to check the contents of an array. This post explores how you can implement this using metaprogramming in Ruby.
January 08, 2023