Fixing a footgun in ActiveRecord::Core#inspect

The inspect method on Active Record models returns a string including the model’s class and a list of all its attributes and their values. In Rails 7.2, you can configure which attributes are included in the output of inspect. In this post, I’ll discuss the performance issue that led me to implement this feature. I’ll also talk about how this feature can be used to improve developer experience.

#Backend#Ruby on Rails
Added: 14 Aug 2024
A useful pattern for handling remote data in React apps | Devin Jameson

Handling remote data state is one of the most common things we do in React apps, so it makes sense to carefully consider how we model it.

#Frontend#Javascript#Typescript
Added: 12 Aug 2024
Preview an Image Before Upload with Hotwire/Stimulus

Learn about JavaScript’s FileReader interface to preview user images before they are upload with Hotwire/Stimulus.

#Frontend#HOTWire#Javascript#Ruby on Rails
Added: 11 Aug 2024
Generating Documentation for Your Rails API: I Build My Own Tool.

After searching for a simple, interactive, and easy-to-use tool to document the APIs I build with Rails, and not finding the right one, I decided to create my own: OasRails.

#Packages#Ruby on Rails
Added: 10 Aug 2024
Should the daily stand-up die?

The daily stand-up was intended to help teammates remove any blockers to commitments. But at many companies, stand-ups have devolved into tedious one-sided status reports.

#Consulting
Added: 10 Aug 2024
Rails Added Filter Option On in_order_of Method

Rails added the filter option to in_order_of to prioritize the specified values without filtering the results

#Backend#database#Ruby on Rails
Added: 10 Aug 2024
Rails 8 introduces a basic authentication generator

Rails 8.0 adds a generator that streamlines the process of adding basic authentication to Rails applications

#Backend#Ruby on Rails
Added: 10 Aug 2024
Introduction to Minitest Mocks

Test doubles likes mocks and stubs can help us with isolating code under test with the rest of the system. Here’s how to mock in Minitest.

#Ruby on Rails#testing
Added: 10 Aug 2024
Why CTOs are choosing Hotwire and Ruby on Rails

A conversation with the CTO and Co-founder of Clara, a recent thoughtbot client, about the strategy behind their decision to build their startup product with Rails and Hotwire.

#Consulting#Frontend#HOTWire#Ruby on Rails
Added: 10 Aug 2024
Automate Your Ruby Gem Releases

Discover how to automate the releases and publication of your gems on RubyGems using release-please and GitHub Actions.

#Packages#Ruby
Added: 6 Aug 2024

The convenience and power of Active Record allows you to interact with your database in a more Ruby-like way, making it easier to write efficient and readable code. However, as with any complex system, performance can sometimes take a hit when using Active Record. One common scenario where performance may suffer is when counting records in your database. In any Rails app, A simple count method call can quickly become a bottleneck, especially for larger datasets. In this post, we’ll dive into some optimization techniques for using Active Record’s count method in your Rails app.

#database#Ruby on Rails
Added: 6 Aug 2024
Betterstimulus | Open-Closed Principle

Good software design is - in part - realized by the capability to introduce changes in a way that isn’t painful. (If you’d like to read up on code smells that violate this principle, take a look at this list of change preventers.)

#Consulting#Javascript
Added: 6 Aug 2024
Secure Your Kamal App Deployments with Let's Encrypt

Do you have a web application deployed with Kamal, but want to know how to set up secure HTTPS connectivity to it? In this video, you’ll learn how easy it is...

#Backend#DevOps#Ruby on Rails
Added: 6 Aug 2024
Supercharge your Rails logs with tags

A hidden Rails feature that can level up your debugging game.

#Backend#DevOps#Ruby on Rails
Added: 5 Aug 2024
From Partials (and Helpers) to Embracing ViewComponent in Rails

The first professionally designed UI components for Rails. Built with ViewComponent, designed with Tailwind CSS and enhanced with Hotwire.

#Frontend#Ruby on Rails
Added: 3 Aug 2024
Semantic search with Ruby on RailsFireHydrant LogoChevron down iconChevron down iconChevron down iconLinkedIn logo iconTwitter logo iconFireHydrant LogoTwitter logo iconLinkedIn logo iconGitHub logo icon

Learn how to implement semantic search in Ruby on Rails using the Neighbor gem, Anthropic's Claude API for summarization, and OpenAI for text embeddings. Enhance your app's search capabilities with meaning-based results.

#AI#Ruby on Rails
Added: 3 Aug 2024
Inline Save and Add Another with Rails and Hotwire

Learn how to implement a Todoist-style task creation feature in your Rails app using Hotwire and Stimulus. This step-by-step guide shows you how to create a seamless, JavaScript-free UX for adding new tasks with auto-focus functionality. Perfect for Rails developers looking to enhance their app’s user experience.

#Frontend#HOTWire#Ruby on Rails
Added: 3 Aug 2024
How to review code effectively: A GitHub staff engineer’s philosophy

GitHub Staff Engineer Sarah Vessels discusses her philosophy of code review, what separates good code review from bad, her strategy for finding and reviewing code, and how to get the most from reviews of her own code.

#Soft Skills#Staff Engineer
Added: 25 Jul 2024
GitHub - GeorgeKaraszi/ActiveRecordExtended: Adds additional postgres functionality to an ActiveRecord / Rails application

Adds additional postgres functionality to an ActiveRecord / Rails application - GeorgeKaraszi/ActiveRecordExtended

#database#Gem#Ruby#Ruby on Rails
Added: 25 Jul 2024
Row pattern recognition feature for PostgreSQL

What is row pattern recognition feature? Row pattern recognition (RPR) is a feature defined in the SQL standard. It allows to search for a s...

#database
Added: 25 Jul 2024
Navigating the new web accessibility ruling in the U.S.

A practical guide to understand the new accessibility requirements and get started with your plan to comply.

#Consulting#Frontend
Added: 23 Jul 2024
Event sourcing for smooth brains: building a basic event-driven system in Rails

Event sourcing is a jargon filled mess, but we can build a lean version with just ActiveRecord, callbacks, and a bit of boring code. Learn how to create simple, yet powerful event-driven systems in Rails.

#Backend#Consulting#Ruby on Rails
Added: 22 Jul 2024
Exercise: Minesweeper in 100 lines of clean Ruby

Ruby is such an expressive language. You can often do surprisingly much with just a few lines of code. It’s why I find it so satisfying to think about how to accomplish the same thing in fewer lines of Ruby1. If we accept the claim that that number of bugs correlates with number of lines of code this is not just a fun exercise. There’s real business value in accomplishing a feature with less lines of code. ↩

#Frontend#Ruby
Added: 22 Jul 2024
Ruby on Rails - July 2024

The only Ruby on Rails newsletter you will ever need!

#Ruby on Rails
Added: 16 Jul 2024
What's new in Web Dev this month?

Hello Devs 👋 I hope everyone's doing great. The landscape of web development is constantly...

#AI#CSS#Frontend#Javascript
Added: 16 Jul 2024
First Previous Next Last