RSSAmplifier

Blog

Joy of Rails

joyofrails.comRSS feed ↗9 posts

Latest posts

A simple trick to understand Ruby’s lazy enumerator

In this article, we'll explore a simple visual trick to help understand how lazy enumeration works in Ruby. Lazy enumeration may seem like an abstract concept at first. It might be difficult to conceptualize. But taking a moment to get familiar with the lazy enumerator pays dividends. Enumerator::Lazy is extremely useful in scenarios where you want to build complex pipelines of data…

What you need to know about SQLite

Have you heard? SQLite is taking the web by storm. The widespread belief has been that SQLite isn’t a production-grade database for web apps. But lately, this sentiment is starting to change. SQLite is already just about everywhere else —smartphones, TVs, web browsers, desktop applications—so why now for web apps? Why now for Rails? It’s basically this: computers have gotten faster, and Rails has…

Joy of Rails 💜 Hatchbox

Joy of Rails deploys to a single VPS hosted by Digital Ocean managed by Hatchbox.io . Hatchbox is a great alternative to managing your own VPS deployment via Capistrano, Mina, or Kamal. There’s a YouTube video that serves as a great intro if you want to learn more. Hatchbox homepage I use a Github Action on the main branch of the Joy of Rails Github repo for continuous deployment. I have spent…

Mastering Custom Configuration in Rails

As your Ruby on Rails application grows, you‘ll need to add your own bits of configuration. Where do you put API keys for third-party apps? What if you need different application values depending on the Rails environment? What if you‘re testing a new feature that should be disabled in production for the time-being? Sure, you can add some ENV vars here and there. You could manually load YAML files…

Add your Rails app to the Home Screen - the Ultimate Guide

I‘m currently obsessed with installing web apps to my desktop and on my home screen. Using Command+Tab on macOS to switch between "sites" is built in to my DNA. Most of the apps shown here are Progressive Web Apps built with Rails As it turns out, several web apps I have installed are built with Rails, including GitHub , Feedbin , Mastodon , Hatchbox , Campfire , and the Rails Discourse forum .…

How to Render CSS Dynamically in Rails

Let‘s talk about how to render CSS dynamically with Ruby on Rails. Most of the time, you might think of CSS as a static asset. But sometimes you want dynamic CSS. Maybe end-user preferences, results of an A/B test, or some organizational data in the system should determine what styles to present. In this post, we‘ll talk about some techniques and considerations to accomplish this in Rails. In my…

Sending Web Push Notifications from Rails

You may have heard news: Rails 8 will extract a new framework for Web Push in Rails. Web Push notifications are powerful because they allow your Rails application to engage with your users even when they’re not on your site . Web Push is a technology enabled by making your Rails app a Progressive Web Application (PWA). With Rails 8, new apps are PWAs by default. And with the pending release Rails…

Custom Color Schemes with Ruby on Rails

This blog post uses Rails and Hotwire to let you edit the color scheme of this site, Joy of Rails . Give it a try. ( Go to the article to see dynamic content ) JavaScript not enabled? Go to the color scheme demo . Then come back when you’re done. How it works Pretty cool, huh? Here are the key ingredients: CSS Variables : Also known as CSS custom properties SQLite : A color_schemes table to store…

Introducing Joy of Rails

How it started, How it’s going In 2007, at my first programming job—a software consultancy—a colleague pulled me aside to demo an app he was building. We huddled around one of the office iMacs where I saw a browser, a basic text editor, and a terminal. In his text editor, there was some HTML markup mixed in with some new programming language called Ruby. The terminal was spitting out a screen full…