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.
Glimmer Button Counter Sample (SWT Desktop & Opal Web)
Glimmer DSL for SWT 4.17.10.5 and Glimmer DSL for Opal 0.7.4 have been released with support for a new sample: Hello, Button! That is the simplest most intuitive button counter code you will find anywhere on earth! Happy Glimmering! https://andymaleh.blogspot.com/2020/12/glimmer-hello-button-sample-swt-opal.html
Climbing Steep hills, or adopting Ruby 3 types with RBS
Yes, types are coming to our favorite dynamic language! Let’s see how to take advantage of them by adding types to a real-world open source project and looking at the finer points of the process.
Bonus! - Day 10 - parslet @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, let’s thank Rachel Green for the tenth (+1 bonus) write-up in the Ruby Advent Calendar 2020 - Day 10 - parslet Gem - Build Your Own Language Parsers (and Lexers) with Parsing Expression Grammars (PEGs). Cheers. Prost.
Day 10 - happy_gemfile @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, let’s thank Mike Rogers for the tenth write-up in the Ruby Advent Calendar 2020 - Day 10 - happy_gemfile Gem - Stop House Keeping Your Gemfile. (Auto-)Format Your Gems Sorted from A to Z and by Groups. (Auto-)Clean up the Clutter. Happy Gemfile Day! Cheers. Prost.
Day 09 - thegamesdb @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, let’s thank Fernando Briano for the ninth write-up in the Ruby Advent Calendar 2020 - Day 9 - thegamesdb Gem - Get Donkey Kong, Super Mario Bros., The Legend of Zelda ‘n’ More. API Client for TheGamesDB, an Open Database for Video Game Data. Cheers. Prost.
Quick Tips for adding a REST API to a Rails Application
Rails projects typically start out fairly simple, but evolve into more complex applications over time. In order to add a client-side framework or mobile application, creating a REST API might be necessary. It’s really straightforward to create a new Rails API. However, it might be easier to add an API to an existing project. There is “right” way to do this, but there are some things to keep in mind that can make future development a bit easier. Full blog post here: https://era86.github.io/2020/12/09/quick-tips-for-adding-a-rest-api-to-a-rails-application.html
Chaskiq 0.6.0 is out, featuring Banners! 💟 and good bye Travis.
We are happy to announce version 0.6.0, this comes with a new feature, Banners! Check the repo https://github.com/chaskiq/chaskiq ! [more inside]
Overriding Rails’ field_error_proc
I always wondered how to set bypass ActionView::Base.field_error_proc on certain forms while leaving it alone for others. It defaults to wrapping form fields with div.field_with_errors, but I sometimes want to handle errors a bit differently. https://zachahn.com/posts/1607312460/
Day 08 - acts_as_tenant @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, let’s thank Chris Oliver for the eighth write-up in the Ruby Advent Calendar 2020 - Day 8 - acts_as_tenant Gem - Together but Apart. House Many Tenants in One Database. Multitenancy with Table Row-Level Database Security. Cheers. Prost.
Why You Should Never Use sudo to Install Ruby Gems
Did you know gems can run arbitrary code during installation? Would you want to risk having your hard drive erased? Follow along with an example of how to build your own gem locally that can run harmless code during installation. [more inside]
Asynchronous Image Processing in Ruby on Rails with Shrine
As Ruby on Rails developers, we often encounter the need to upload and store images provided by our users. Often these images need to be resized and saved as multiple versions: for mobile, web, thumbnails, OG images, and other custom and non-standard formats needed by the Client. What problem does it lead to? Image processing is a computationally intensive operation and the latency will inevitably drop. Solution? Sidekiq + Shrine! Asynchronous Image Processing in Ruby on Rails with Shrine
How to use Stimulus JS 2.0's new Values and CSS Classes APIs
The long awaited changes for Stimulus JS’s Values and CSS Classees APIs were released last week. These allow you to specify options (and types!) for your Stimulus controllers making them way cleaner to implement. Watch the screencast on How to use Stimulus JS 2.0’s new Values and CSS Classes APIs
[Screencast] The Stimulus 2.0 Tutorial
Stimulus 2.0 has been released and with it comes new features, changes and bug fixes. In this episode, we look at adding Stimulus in our application, exploring the new features, and looking at what has changed. https://www.driftingruby.com/episodes/the-stimulus-2-0-tutorial
Day 07 - letter_opener @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, let’s thank Matt Swanson for the seventh write-up in the Ruby Advent Calendar 2020 - Day 7 - letter_opener Gem - Let Your Browser (Automagically) Open-Up Your Email Letters for Previewing. Stop Sending Emails to Yourself for Testing. Cheers. Prost.
Code Diary: How and Why to Keep One
As a developer with 10+ years of experience, I get value from keeping a code diary, a place to think aloud about design decisions, analyze impressive scraps of code found in the wild, or extract learnings from past mistakes. Here’s a video about the diarying process and the benefits: https://www.youtube.com/watch?v=tarmCEHfGa0
Day 06 - pay @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, lets thank Chris Oliver for the sixth write-up in the Ruby Advent Calendar 2020 - Day 6- pay Gem - Accept (One-Time) Payments or Subscriptions with Strong Customer Authentication (SCA) - Billing Engine on Top of Stripe, Braintree or Paddle. Cheers. Prost.
Using Docker on Apple silicon with a remote Docker engine
Not strictly Ruby, but many Ruby developers use Docker. I wrote a post on using a remote Docker engine on the new Apple silicon Macs while we wait for official support. The post also covers a workaround for bind mounts which otherwise don’t work with a remote Docker engine. I have been working with this setup for a couple of days now and I barely notice the difference compared to a normal Docker setup. Hope it’s useful to others too. [more inside]
Day 05 - factory_bot @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, lets thank Jason Swett for the fifth write-up in the Ruby Advent Calendar 2020 - Day 5 - factory_bot Gem - “Hey, Make Me a User with an Email and Password” - Setup Factories That Make You Fake Objects with Fake Data for Testing. Cheers. Prost.
Rails & Next.js Project Skeleton (w/ Docker)
Running Rails with a separate frontend app doesn’t have to be complicated: https://twitter.com/p_ch/status/1334802423882330112
Day 04 - noticed @ Ruby Advent Calendar 2020 - 25 Days of Ruby Gems
Hello, lets thank Chris Oliver for the fourth write-up in the Ruby Advent Calendar 2020 - “Day 4 - noticed Gem - Send Notifications Immediately or for Later Delivery (in the Background) via Email, Slack, Text Message, Real-Time ActionCable in the Navbar or Many More Channels”. Cheers. Prost. PS: This notification is (old-school) hand-delivered :-).
Ruby on the Frontend? Choose Your Weapon
We all know that Ruby is a great language to use for the backend of your web application, but did you know you can write Ruby code for the frontend as well?