Below you will find pages that utilize the taxonomy term “Ruby on Rails”
Posts
Validating HTTP(S) URLs in Ruby on Rails
Regular expressions are not a great way to validate URLs. Using Ruby’s built-in
URI parser, a custom Active Record Validation Helper can be built to safely
validate URLs in Ruby on Rails applications while allowing for flexible domain name
allow-listing.
Posts
Adding TypeScript to your Svelte components in Rails 6
Combine Svelte and Typescript with Ruby on Rails' Webpacker to improve your JavaScript workflow and get better feedback in your editor.
Posts
Moving from Capybara to Cypress
Cypress makes writing integration tests (or system tests) easier and more fun. This posts shows you the tools needed to add Cypress tests to your Rails application.
Posts
Deploying Ruby on Rails apps to Kubernetes from Gitlab CI
Gitlab CI allows you to create and manage Kubernetes clusters directly from the interface and easily deploy builds to your existing Kubernets infrastructure. Here’s how.
Posts
Add jemalloc to your Ruby Docker images, now!
The topic of this post is neither new nor original, so I’m going to keep things short. People have been using jemalloc with MRI Ruby for years and praising it’s benefits all the while. The TL;DR here is: for Rails apps, using jemalloc will reduce memory consumption and might increase performance a little.
Why? To illustrate my own experience, here’s a Grafana graph showing the effect of switching to jemalloc on a production server running a few instances of a Rails application:
Posts
Disable JavaScript source maps in production Rails applications
Ruby on Rails 6 allows us to leverage the excellent Webpack bundler to manage JavaScript and CSS components in a way that’s more native to those technologies than the old asset pipeline: no more gems to wrap JavaScript libraries and no more libv8 gem issues.
Another advantage Webpack brings is the excellent source maps. I was surprised to see the source code of my Svelte components, complete with comments available from the Firefox development tools: