The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Persist data when rebuilding a Rails development environment
This week in my experiments with Docker, Rails, and developer happiness, I realized that rails db:setup has a nasty side effect of wiping out any existing development data! I stumbled upon a nice workaround for persisting development databases, though, that’s good to know even if you’re not using container-based dev environments.
Rails Best Practices After 10yrs
In this video I go through about 10 Rails best practices which have given me great mileage [more inside]
[ANNOUNCE] - NHI1 - something that writes code for you
INTRO → https://nhi1.selfhost.co/wiki/index.php?title=NHI1_-_the_POWER_of_programming HOME → https://nhi1.selfhost.co/nhi1 RUBY → https://nhi1.selfhost.co/nhi1/rubymsgque/rubymsgqueref.htm COMPANY → https://nhi1.selfhost.co
Glimmer DSL for SWT 4.18.5.4 Nested Shapes with Default Bounds
Glimmer DSL for SWT v4.18.5.3 & v4.18.5.4 got released with support for Nested Shapes, Centering within Parent, Default Auto-Calculated Dimensions, and Shape Data-Binding Hello, Canvas! Sample Changes: [more inside]
Rails introduces new syntax for enum
Hi, My post on Rails introduces new syntax for enum is live on blog.saeloun.com.
Ruby on Rails vs. Express.js. A Ruby Dev Shop Owner Perspective
Ruby on Rails vs. Express.js. A Ruby Dev Shop Owner Perspective [more inside]
Flipper.enable(☁️)
Even when you have a fully functioning product, there are a few hurdles to launching it. Read on to learn how I tackled them. [more inside]
Programming CryptoPunks & Copypastas w/ Ruby - Step-by-Step Booklet / Guide
Hello, I have started with a new (free online) booklet in the crypto collectible series titled Programming CryptoPunks & Copypastas Step-by-Step Book / Guide - Inside Unique Pixel Art on the Blockchain…. The first two chapters so far: 1) Do-It-Yourself (DIY),Yes, You Can Mint Your Own Punks in Original 24x24 Pixel Format or With 2X / 4X / 8X Zoom ++ 2) Statistics, Statistics, Statistics - Calculate Rarity & Popularity By Type, By Accessories, & More - Inside the 10 000 Punk Population. Cheers. Prost.
Refactoring Technique: Replace Conditional With Polymorphism
There are many ways to refactor a method with many conditionals. Before reaching for dependencies like dry-matchers, consider keeping it simple by using plain Ruby classes.
Free Ruby/Rails virtual bootcamp for under-represented groups
I’ve been discouraged recently seeing a bunch of friends from under-represented backgrounds being rejected from PAID tech bootcamps because they didn’t pass the screener. [more inside]
Finding and Fixing Missing Indexes in A Rails App with New Relic
In this post I walk through how I discovered a performance issue, determined the cause, fixed it, and verified the fix. https://scottbartell.com/2021/02/24/finding-and-fixing-missing-indexes-in-a-rails-app/
Log API requests in Rails
When exposing or consuming APIs, one of the most important things to remember is to log the calls you perform. [more inside]
render_async Adds Support for Rails Turbo
Read about how we came to support Turbo and what are our plans for the future. https://pragmaticpineapple.com/render-async-adds-support-for-rails-turbo/
Glimmer DSL for SWT Hello, Color Dialog! & Hello Font Dialog!
Glimmer DSL for SWT v4.18.5.1 & v4.18.5.2 just shipped with support for the color_dialog & font_dialog keywords and improved shape point inclusion detection. Happy Glimmering!
https://andymaleh.blogspot.com/2021/02/glimmer-dsl-for-swt-hello-color-dialog.html
New strings-truncation gem
The strings-truncation truncates strings with fullwidth characters, for example those found in Chinese, Japanese or Korean language. It also preserves ANSI codes so it’s suitable for building terminal applications. The characters can be omitted from the start, middle, end or both ends. Enjoy!
Dynamic Form Options With Hotwire Turbo Frames
I needed a way to dynamically show and hide form options based on what a user selects and wanted to use Turbo Frames. The benefit being all of the logic can be in the erb file of what to show and hide based on the current state of the model. [more inside]
Code Loaders in Ruby: Understanding Zeitwerk
What makes Rails magical? It just might be its code loader. Put a few files in the right places, and - presto! - you have a web app. When you use a class, Rails handles the include so you can stay focused on your code. But this magic isn’t just for Rails! You can add thread-safe code loading to your own apps via the Zeitwerk gem. In this article, Olasubomi introduces us to Zeitwerk and shows us how to integrate it with our own projects. https://www.honeybadger.io/blog/ruby-code-loader-zeitwerk/
Rails, Docker, and developer happiness?
Container-based Rails development environments have never sparked joy for me, and I’d like to change that. I’ve started a series of experiments with Docker-based Rails development environments, to deepen my understanding and hopefully make a more pleasant developer experience. So far, I’ve shared my rationale and methodology and initial setup experience on Everyday Rails.