Things we have to say.
Our articles are thoughts, tips and tricks we found in our daily work.
Best practices on tiny plates, easy to consume, easy to eat, easy to love!
🥘 Hot and spicy 🌶️ knowledge about
#rails #tailwindcss #ruby #design #css #view components #bootstrap #raspberrypi #docker #ohmyzsh #stimulusjs #action mailer #regex #active storage #zsh #git #github #visual studio code #esbuild #dev containers #javascript
Adding File Validation to Lexxy Editor with Stimulus.
A simple Stimulus controller to validate attachments in the Lexxy editor — restricting file types and sizes before they get uploaded.
Unlocking Rails cycle: A Hidden Gem for Views.
Did you know Rails’ cycle can do more than just alternating row colors? From dynamically styling elements to structuring repeating patterns in views, it's a powerful tool for keeping your templates clean and efficient. Discover how to unlock its full potential and simplify your Rails views!
Rails Without Ruby.
Yes, you can run Rails without installing Ruby. With VS Code devcontainers, your whole Rails setup lives inside Docker — no version managers, no system dependencies, just rails new and go.
Migrating a legacy database into an existing Rails app.
Learn a simple ActiveRecord and Rake-task driven approach to migrate data from a legacy database into your existing Rails app.
Easy Redesign in Rails: Run Old and New Side by Side with :variants.
Rails variants are usually used to serve different views for devices — but you can use them for much more, like running a redesign side by side.
Organizing Mailer Templates with prepend_view_path in Rails.
Tired of hunting for email templates scattered across your Rails app? If your mailer views are spread throughout app/views
like confetti, there's a simple solution you might not know about. Learn how prepend_view_path
can help you organize all your email templates in one clean, centralized location – and why your future self (and your team) will thank you for it.
Use Rails I18n for more than translations.
Discover how to leverage Rails I18n beyond its traditional translation role. Learn practical examples of using the internationalization framework for managing multi-domain configurations and context-specific content, making your Rails applications more maintainable and flexible.
Hide Scrollbars While Keeping Scrolling Intact.
Want to keep your UI clean by hiding scrollbars while still allowing users to scroll? In this post, we’ll explore different CSS techniques—including Tailwind-friendly solutions—to achieve a seamless scrolling experience without the visual clutter of scrollbars.
Enhancing Esbuild Error Handling in a Rails App.
When working on a Rails app using esbuild, encountering build errors can be frustrating — especially when they don’t surface in a way that makes debugging easier. To improve the developer experience, I implemented an automatic error rendering system that displays esbuild errors directly in the browser during development.
From Sticky to Pinned: A Stimulus Controller Approach.
Sticky elements are a game-changer for modern UIs, but what if you could detect exactly when they get pinned? Using a Stimulus controller, we'll show you how to track sticky behavior with ease. Perfect for adding dynamic flair to your app — don’t miss out on this sticky solution!
How to Customize Rails Form Error Handling.
If you've worked with Rails forms, you've likely encountered the infamous .field_with_errors wrapper
. While it's designed to help highlight invalid fields, it can wreak havoc on your HTML structure and CSS styles. Fear not — there's an easy way to disable it!
How to Create Custom Error Pages in Rails.
Don't let error pages break your brand's flow. Learn how to create custom error pages in Rails that match your design, keeping the user experience smooth—even when things go wrong.
Interactive Git Checkout.
Simplify your Git workflow with an interactive branch switcher. Learn to use fzf, the fuzzy finder, alongside Git commands to effortlessly navigate and switch between branches, enhancing your development efficiency.
Cleaning up with clearing rake tasks.
Learn how to easily cleanup your Rails log
and tmp
files.
Introducing RailsbootUI: Rails View Components for Bootstrap.
We released a new product: RailsbootUI - it's our take on providing a simple yet professional view component collection for Rails with Bootstrap as the CSS framework under the hood.
Use gems from private GitHub repos.
Learn how to seamlessly integrate private gems from GitHub into your Ruby projects. This guide covers setting up your Gemfile, configuring local credentials, and using GitHub Actions for authentication. Perfect for developers looking to enhance their workflow with private repositories.
Use CSS Grid to stack items.
Discover how to use CSS Grid to stack items efficiently without relying on absolute positioning. This guide explains how to position elements within the same column and row, using both CSS and TailwindCSS, to create flexible and responsive layouts.
Profiling zsh setup with zprof.
Optimize your zsh setup by profiling with zprof. This guide shows you how to identify and eliminate performance bottlenecks in your .zshrc file, ensuring faster startup times and a smoother shell experience.
Purge unattached ActiveStorage::Blobs.
Keep your storage clean by purging unattached ActiveStorage::Blobs. This guide walks you through setting up a rake task to automatically remove blobs that are no longer linked to records, saving space and reducing costs.
Unlocking the Superpower of Regular Expressions in Find and Replace for Visual Studio Code.
Unlock the full potential of Visual Studio Code with regular expressions in Find and Replace. This guide shows you how to use regex for precise text modifications, making complex tasks simple and efficient. Learn about capturing groups, replacement patterns, and practical examples like date format transformation.