Claude.md files are special Markdown files used by Claude Code, an AI-powered coding assistant by Anthropic. A Claude.md file serves as a "control panel" or "pre-flight briefing" for Claude, providing project-specific context and instructions to guide its behavior. Most projects that utilize claude code or other agentic AI tools use a version of this claude.md
Ruby's Enumerable#partition method is one of those hidden gems that can dramatically simplify your Rails code. This method splits any enumerable collection into two arrays based on a block condition, returning both the elements that match the condition and those that don't in a single operation. Instead of filtering your data multiple times or writing...
Recently I had the need for a signal strength UI indicator in a ruby on rails app and I didn't see one anywhere so I had to make one from completely from scratch. In the spirit of giving back to the community, here is that code as a viewcomponent. It may need some tweaks to...
Building AI powered features into Ruby on Rails applications has become increasingly common, but the development process can quickly become expen$ive and cumbersome when you're constantly hitting external APIs during testing and iteration. Every debug session, feature experiment, and streaming test can rack up costs while you wait for network requests to complete. This is...
Ruby on Rails has quietly introduced one of the most practical features for maintaining large-scale applications: the ability to mark associations as deprecated. This seemingly simple addition addresses a common pain point that many Rails developers have faced when working with legacy codebases or evolving application architectures. Anyone who has worked on a mature Rails...
As AI models become increasingly sophisticated, many website owners such as myself are concerned about their awesome blog posts being scraped and used to train AI systems without permission. If you're running a Ruby on Rails application and want to prevent AI bots from crawling your site, implementing proper bot blocking measures is essential. The...
Recently,. there was a discussion amongst my colleagues about why some of the models in our Rails 8 app inherit from ApplicationRecord while others inherit from ActiveRecord::Base. Lets dig in to these subtle but important distinctions, shall we? ApplicationRecord is a class that inherits from ActiveRecord::Base and serves as the base class for your applications...
Outlets represent one of Stimulus's most sophisticated tools for enabling seamless communication between javascript controller instances. Rather than relying on cumbersome event dispatching or global state management, Outlets provide a clean, declarative way to establish connections between different controllers using familiar CSS style selectors. (That is a bit of an oversimplification, TBH, but that is...
If you are looking to hire a ruby on rails developer that specializes in the ‘Hotwire' ecosystem of Turbo, Stimulus, and View Components, do drop me a line so we can have a chat.
Rails applications are full of callbacks that control the flow of your models' lifecycle events. Whether it's before_save, before_create, or any other callback, these hooks are essential for maintaining data integrity and business logic. But what happens when something goes wrong and your callbacks start throwing :abort? That's where Rails' lesser-known halted_callback_hook comes to the...