- Short Ruby Newsletter
- Posts
- š¤ Short Ruby News - Edition #53
š¤ Short Ruby News - Edition #53
Discover the world of Ruby in this comprehensive newsletter covering week 29 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
You can jump directly to a section:
š Our Community
More content: š š§ š„ āš¾ (articles, podcasts, videos, newsletters)
[Sponsorā¬]
Harrison here from The RailsNotes Newsletter ā each week, I send out a 5 min read covering a few great Ruby on Rails articles from my blog and around the web. If you like ShortRuby, you'll probably like The RailsNotes Newsletter, too, so come check it out!
Subscribe and read the latest issue here ā https://railsnotes.xyz/newsletter
š Our Community
š Kasper Timm Hansen announced a new project called Open Source Retreat ā Summer 2023
š RailsWorld published the final list of speakers Meet the Rails World Speakers:
š Avi Flombaum started to re-start the NYC on Rails | Meetup again:
š Avi Flombaum also announced rails-components.com - Themed Components for Ruby on Rails
š Ruby City Matsue announced Ruby Prize 2023 is now accepting recommendations:
š Chris Oliver announced the beginning of Rails Hackathon Begins which happened in the last weekend.
The hackathon ended but you can see the projects at railshackathon.com and vote the ones that you like.
š The Rubber Duck Dev Show shared their schedule for the next month:
š All about Code and Ruby
š /u/eggbrain asked about the current state of Rails WYSIWYG / Rich Text Editor integrations:
The recommended answers are:
Editor.js - for ingregration checkout Dean videos Editor.js in Ruby on Rails 7 with Stimulus! and Editor.js Image Uploads with Active Storage
Rhino-editor (that integrates TipTap currently)
Quill (integrates via quilljs-rails)
š Okura Masafumi shared how they think about tests and using tests as documentation:
š Xavier Noria shared a thread about :: in Ruby:
And Yukihiro Matz replied:
Kevin Newton added:
Nick Schwaderer shared gist showing other ways to use ::
and Xavier added more:
š Nick Schwaderer shared a code sample from Scarpe Morning serenity bloops song to wake people up and get their hackdays started right by Schwad Ā· Pull Request #327 Ā· scarpe-team/scarpe
š I asked about recommendations of open-source repos:
You can read the replies on ruby.social and on twitter (alternative on nitter)
Here are some of the recommendations:
Anything written by Nate Berkopec or Chris Oliver
act_as_tenant gem
invoice_printer gem
batch-loader gem
friendly_id gem
ializer gem
money gem
propshaft gem
pundit gem
rolify gem
š Marco Roth shared a code sample showing how to use the Stimulus Elements API (read the full blog post)
š Olivier Lacan asked about recommendations of Ruby powered companies working on climate solutions:
š Rob Zolkos asked a question on social media and on the Ruby on Rails forum Do Basecamp/Hey use ViewComponents?
š Olivier Lacan shared a screenshot of bundle up gem:
š Nate Hopkins announced a revamped of the TurboBoost Commands website:
š Jonathan Markwell shared what projects helped them the most for building SaaS:"
š¤ If you like the newsletter and can afford you should consider upgrading to paid. It is 6.5$ per month. You will get a free from ads and upgrade invitations (like this one) version while supporting this project to continue to be free and sustainable.
š Janko MarohniÄ shared a thread about generating passkeys with Rodauth:
š The Rails Changelog shared a Rails tip to append to a collection of attached files:
š Greg Navis shared about the Ruby safe navigation operator is a code smell:
Among other replies, Rostislav Zhuravsky shared another perspective about this:
š Marc Kƶhlbrugge shared how they use SQL queries to do funnel analysis:
š Martin Spickermann shared a piece of code showing how to use ActiveRecord#find
š Greg Navis shared a thread about database constraints in Rails. Read the full thread @gregnavis or read it on nitter:
š John Nunemaker shared how to use bundler to update git source:
š Chuck Smith shared about the biggest challenge as a contractor when upgrading Rails:
Adrian Oprea replied with:
š Adam shared about memoizing a class instance variable and thread safety:
š Harrison Broadbent shared a tip to make a turbo frame tag scroll into view:
š§° Gems, Libraries, Tools and Updates
š§° Lewis Buckley announced a new gem basecamp/rspamd-ruby: Ruby client for Rspamdās HTTP API. Rspamd is a āFast, free and open-source spam filtering systemā
š§° JetBrains announced the release of RubyMine 2023.2 with AI Assistant included. Read the full list of improvements in the Whatās new announcement
š§° Dima Fatko published a new version of online_migrations (āCatch unsafe PostgreSQL migrations in development and run them easier in productionā)
š§° Steve Jackson and Daniel Huss published a new gem gem_dating - GemDating is a library for determining the relative age of a set of gems
š§° Charlton Trezevant announced a new gem devise-sssecrets - is a handy gem for generating secure tokens that are easy for static analysis tools to identify (you can checkout the Rails demo app here)
š§° Igor Alexandrov announced the Release v0.15.0 Ā· mrsked/mrsk
š§° Brad Gessler announced rubymonolith/guard-zeitwerk: Automatically add module declarations, inflected from Zeitwerk, to your empty files.
š§° Xavier Noria announced the release of version 2.6.9 of Zeitwerk Read the changelog
š§° Takashi Kokubun announced the merge of YJIT: Fallback send instructions to vm_sendish by k0kubun Ā· Pull Request #8106 Ā· ruby/ruby
š§° Andrea Fomera announced a new gem afomera/richer_text - RicherText is a Rich Text Editor based on TipTap for Ruby on Rails
š§° Koichi Ito shared GitHub - rubocop/vscode-rubocop: The official VS Code extension for the RuboCop linter and code formatter that enables real-time, high-speed `rubocop -x` in VScode:
š§° Janko MarohniÄ announced the Release 1.10.0 Ā· janko/rodauth-rails
š§° Avi Flombaum announced the release of version 0.5.0 of shadcn-rails. Checkout latest commits
š§° Janko MarohniÄ shared that support for passkeys is released to roaduth Add internal request support for WebAuthn by janko Ā· Pull Request #355
š§° Brad Gessler announced they proposed a PR (not merged) for Implementation of Phlex::Rails::Actions by bradgessler Ā· Pull Request #104 Ā· phlex-ruby/phlex-rails
š§° Lewis Buckley announced a new plugin for yabeda basecamp/yabeda-rack-ratelimit: Yabeda plugin for Rack::Ratelimit
š§° JuliĆ”n PinzĆ³n shared that this PR is merged to cssbuilding-rails Add PostCSS import plugin as default by pinzonjulian Ā· Pull Request #126
š§° Greg Navis announced a release of a new version active_record_doctor - Identify database issues before they hit production
š§° Thomas Countz announced version 0.2.0 of their genetic algorithm gem petri_dish_lab - A Ruby library for Evolutionary Algorithms
š§° Evgeniy Demin announced a new release of djezzzl/n1_loader: Loader to solve N+1 issues for good. Highly recommended for GraphQL API.
š§° Joshua Young proposed a new feature to be added to Ruby language Enumerable#uniq_map
Thank you for reading Short Ruby Newsletter. This post is public, so feel free to share it.
š¤ Related (but not Ruby-specific)
š¤ Andrew Morris shared what Kafka is exchanging as commands for the health check:
š¤ Adrian Oprea shared an insight about simple code:
š¤ More content: š š š§ š„ āš¾
š Newsletters
š Harrison Broadbent published a new edition of RailsNotes Newsletter Issue 4
š Ruby Weekly published a new edition about Machine learning in Ruby
š Ruby Radar published a new edition about Mind Expansion
š Matheus Richard published a new edition of This week in #dev
š This Week in Rails published a new edition This Week in Rails - July 28, 2023
š Ruby LibHunt published a new edition of the Awesome Ruby Newsletter
š Ruby Central published a new edition of their monthly updates June 2023 Monthly Update
š The Bike Shed published a new episode about Submitting a Conference Talk Proposal from Start to Finish
š§ Podcasts
š§ Rubber Duck Dev Show published a new episode about Scarpe Diem With Nick Schwaderer ā āIn this episode of the Rubber Duck Dev Show, we discuss Scarpe, which is a successor to the Shoes Ruby desktop application builder with Nick Schwadererā
š§ Remote Ruby published a new episode about The One Where We Talk About Our STIs ā āJason, Chris, and Andrew dive deep into their personal adventures and tech talks, including a detailed discussion on Single Table Inheritance (STI) in Ruby on Rails, sharing different perspectives, use-cases, and alternatives.ā
š§ Indie Rails published a new podcast about IndieRails | Khash Sajadi - The Journey to the Cloud(66) ā āJoin us as we listen in to Khash as he shares his story of startup failures & successes, consulting and employment in between and navigating political, economic and geographical constraintā
š§ The Ruby on Rails Podcast published a new episode about Gnarly Rails with Nick Maloney ā āNick and Brittany discuss Gnar's project for the State of Massachusetts to build out an automated background check system. Nick shares why Rails is their default stack and why he is particularly impressed with the direction of the front-end happening in Rails 7.ā
š§ Jason Swett published a new podcast about 191 - Payload CMS (YC S22) with Dan Ribbens - The Code with Jason Podcast ā āThis week, I'm joined by Dan Ribbens for an in-depth conversation about his headless CMS software Payload CMS. We also discuss other CMS platforms and Dan's experience with Y Combinatorā
š§ Slow & Steady published a new podcast about Database constraints with Andrew Atkinson | Slow & Steady ā āBenedikt talks to Andrew Atkinson about different types of database constraints and his upcoming bookā
š½ļø š„ Videos
š½ļøAny Cable published a new video about AnyCable v1.4: reliable real-time for all: Ruby, Rails, Hotwire and beyond
Screencasts
š„ Dean De Hart published new videos about:
š„ Ruby Cademy published a new video about IntuitiveClassName + EncapsulatedMethods = Joy!
āš¾ Articles
Whatās new
Breno Gazzola published a great guide about Active Storage in production: lessons learned and in-depth look at how it works ā āWhile we love Active Storage (which Iāll call AST from now on), there are certain design decisions in AST that one should be aware of, as they have an impact on the overall performance of the app, and not just the pages that use ASTā
Nikola Äuza published a new article about Using Server-Sent Events (SSE) to Stream Data in Rails ā āUsually, a page sends a request to the server to receive new data. That is how most of us develop the web nowadays. What if I told you there is another way to get the data to the page? With server-sent events, a server can send new data to a web page at any time by pushing messages to the web page.ā
Marco Roth published a new article about Supercharge your Stimulus controllers with Custom APIs ā āwe will explore the process of creating a new Stimulus API that can be used in any Stimulus Controller.ā
Avi Flombaum published a new article about Building shadcn Form Builders in Rails ā āFor shadcn on rails, I wanted to create a custom form builder that would plug my shadcn form inputs and controls into ActiveModel so that the error validations and other features native to Rails forms would workā
Kevin Luo published a new article about Dear AI, can you translate the Rails Guide for me? ā āI used ChatGPT API to translate the Rails Guide into different languagesā
Alkesh Ghorpade published a new article about Rails 7.1 adds the --parent option to the controllers ā āRails 7.1 adds the --parent options to controller generator that helps the developer pass the parent controller name. You must pass --parent=CONTROLLER_NAME to the rails generate controller commandā and another one exploring Rails 7.1 adds picture_tag helper to support HTML5 picture element.
Steve Polito published an article, about Are you absolutely sure your Rails caching strategy isn't leaking sensitive information? ā āRails writes a new cache entry based on the first request. But what happens when that request is from an admin?ā
Rafael PeƱa Azar published a new article about Exploring Genetic Algorithms with Ruby ā āwe'll dive into the intriguing realm of genetic algorithms in Ruby and explore real-life applications that showcase their potential. These algorithms mimic the principles of Darwinian evolution, and when combined with the expressive and elegant Ruby language, they become a powerful toolset for tackling a wide range of challengesā
Lucas Barret published a new article about Services Object with GraphQL And Rails ā where Lucas explains how a service layer in Rails and GraphQL can manage code complexity, improve readability, and enable better testing..
Avi Flombaum published a new article about Generating Audio Waveform Images in Ruby ā āIn this post we'll walk through some Ruby code that generates a waveform image from an audio fileā
Gavin Morrice published a new article about Avoiding train-wrecks in ActiveRecord ā āone doesnāt have to look far in a Ruby on Rails codebase to see chains of ActiveRecord scope methods being called on a model or ActiveRecord::Relation object like this. This chain of methods all smooshed together like a crashed train with many carriages is what some people affectionately call a Ā«train-wreckĀ»ā
Deep Dives
Cody Norman published a new article about Using Concerns With Ruby On Rails ā āI thought this was a great opportunity to refresh myself on some of the details around Concerns in Rails, why theyāre useful and how to implement them.ā
Olly Chadwick published two articles about Loading files in Ruby and Loading files in Rails ā ā First, weāre going to talk about how Ruby finds other files. Then, once weāve got our head around that, weāre going to look at the extra sprinkles of magic that Rails adds on top.ā
Daniel Lempesis published an article about An Introduction to Metaprogramming in Ruby ā āIn this post, we'll take a look at metaprogramming methods like send, define_method, and method_missing and show how they can solve problems we sometimes run into, even in normal Rails applicationsā [If you want you can check the comments about this on HN]
Andrew Stewart published an article about Introduction to Discard ā āToday, weāre going to explore the history behind the discard gem, and how it can be used to add soft-deletion functionality to Rails/ActiveRecord modelsā
Vlad Hilko published a new article about Understanding Transaction Isolation Levels in Rails with Simple Examples ā āwe will discuss the usage of database transactions in a Rails application, with a particular focus on one of the ACID principles - Isolation - and its four levels. We will explore what these isolation levels are, why they are necessary, and the problems they aim to solveā
How-Tos
Carla Urrea Stabile published a new article about What is Role-Based Access Control (RBAC) and How to Implement it in a Rails API? ā āThere are different ways to implement an authorization system and the one you chose depends on your application's needs. Role-Based Access Control (RBAC) is just one of them, so let's go ahead and learn how to implement it in a Rails APIā
Janko MarohniÄ published an article about implementing Passkey Authentication with Rodauth ā āI would like to show how to set each of these up in a Rails app that uses rodauth-rails. Iāll be using Safari on macOS Ventura and have iCloud Keychain sync enabled, which is a requirement for Apple passkeysā
Mike Coutermarsh published a new article about Setting an Actions secret with Octokit.rb - Ruby Example ā āHere's a Ruby example of how to set a GitHub Actions secret using Octokit in Rubyā
Gowsik Vivekanandan published a new article about Integrate Replicate in Rails Application ā āWith Replicate, we can run machine learning models in the cloud without the need to set up our infrastructure or have in-depth knowledge about machine learning. Replicate allows us to run both public and private modelsā
Harrison Broadbent published two articles Simple Lazy Loading in Rails with Hotwire and Turbo Frames āāHotwire and Turbo Frames make it easy to add lazy-loading into our Rails apps ā I'm talking only 12 lines of codeā and Overmind šŖ¬, a better bin/dev for your Procfile ā āI wish I had learned about Overmind sooner! Foreman and bin/dev were fine, but now that I've discovered Overmind, I don't see myself ever going backā
Akshay Khot published a new article about How to Dynamically Create Instance Variables in Ruby ā āThis post shows one way to dynamically initialize multiple instance variables in a Ruby class using metaprogramming. If you need to pass multiple, separate pieces of data to a constructor (and cannot refactor the code for some reason), it's a pretty good technique to reduce all the repetitive code.ā
Matt Brictson published an article about How to organize CSS in a Rails project ā āNew Rails projects start with a single CSS file: application.css. Inevitably every non-trivial app is going to have more CSS than will fit comfortably in that one file. While you may be tempted to declare a comprehensive file and folder structure up front, I suggest starting small and taking the incremental approach.ā
Phil Smy published a new article about Revolutionize Your Rails App with DynamoDB: Unleash Speed and Scalability! ā āWhen developing a new service, we realized that a core model would be well-suited for storage in DynamoDB, Amazonās fast and scalable NoSQL solutionā and another one about A Seamless Migration from Database to AWS S3 ā about migrating email messages stores in a DB to S3 storage system.
Fiona Lapham and Ariel Juodziukynas published an article about Navigating Asset Management Madness; Rails 3.0 -> Rails 7 and Beyond ā āThere have been a lot of changes over the years in asset management opens a new window for Ruby on Rails applications. The main question, after all the madness, isā¦ āWhat should I do if I need to upgrade my Rails application?ā
Avi Flombaum published a new article about Prettier for ERB ā where Avi shares a configuration to make prettier work with *.erb files
Thomas Hareau published an article about How to release a new gem version in thirty seconds ā āI recently experimented process automation through GitHub action. Though there is one drawback in term of security, new gem versions can be released in two clicksā
Related
Ryan Bigg published a short article describing how to fix How to fix: Chromedriver 115, cannot find chrome binary on MacOS ā āChromedriver v115 was released recently and causes this issue to appear on Macs that use Chromedriver for automated testingā
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:
If you consider upgrading and want more information, please read Why to subscribe to paid.
Reply