Referencing Stimulus Controllers as ViewComponent Sidecar Files with Propshaft Importmaps
AKA: How many Rails buzzwords can I fit in a single blog post title?
AKA: How many Rails buzzwords can I fit in a single blog post title?
I wanted to play with the new hotness of Rails asset handling in a sideproject , and ran into some fiddliness in getting FontAwesome webfonts to be seen when loading them from an SCSS file. I'm using propshaft and Dart Sass in this app to build my CSS assets, and there wasn't any documentation I could find on how to reference your local font files within your SCSS files.
One of the best things about Rails, that it gets right over so many other frameworks like React, is its Directory Naming Conventions . You can jump into any Rails app written in the last 15 years and no immediately where to go to start exploring. Where's the routes? Database Models? Controllers and Views? Every app keeps them in the same place, so once you learn it, you can easily transfer that…
In this post, I will provide some code to make working with an Enum data type in Postgres easier within your ActiveRecord models. Skip to the end for the code, or stick around for some verbose pontificating.
The point of this post isn't to convince you of the usefulness of Dependency Injection there's been plenty of pixels spilled about it already . Instead, I want to talk about using Dry::Container to alleviate some of the pain points that DI introduces.
A good way to look at the advantages of a hypermedia-based API vs an "HTTP-RPC" style one is to consider the differences between "In-Band" and "Out-of-Band" information. A hypermedia API focuses on getting as much information in-band as possible, reducing the burden on clients to deal with changes.