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.
Today
How to setup monthly subscriptions in Rails with Stripe
I published a video tutorial showing how to add monthly subscription (SaaS) payments to a Rails marketplace app with Stripe.
We upgraded our Open Source Job Board App (DollarJobs) from Rails v6.1 to v8.0
https://github.com/bestwebventures0/dollarjobs/compare/main…upgrade_to_rails_8. We use Ruby 3.3.6, Rails 8.0.0.1, Webpacker 5, Sprockets 4, SQLite 2, Jquery, etc. Use Dollarjobs to build your own job board for FREE. The only missing part is Deployment using Kamal. If someone is willing to contribute, please get in touch with me.
How to use remote build server in Kamal?
I wrote a new post on how to use remote build server in Kamal.
Ruby Version Manager 4 Windows v1.0.0 released
The final version 1.0.0 of the Ruby Version Manager for Windows (rvm-windows) has been released. It is inspired by the rvm.io project for Unix systems and provides a similar user experience for Windows users by providing a compatible command line interface. The Ruby Version Manager for Windows is a command line tool that allows you to easily install, manage, and work with multiple Ruby environments from interpreters to sets of gems. It even works with the classic Windows command line aside from Powershell and is based on the x64 binaries provided by the RubyInstaller project. Its goal is not to 100% reimplement all features of rvm.io, but the most important and common ones by preserving most of the same command line interface. Some special Windows related stuff is added as well. More information can be found on the rvm-windows Github repository.
async_magic gem
https://github.com/igorkasyanchuk/async_magic gem that lets you execute code in the background without sidekiq, or active job. [more inside]
The DCR Kids Programming Language Supports Live GUI Updates
One of the requests I received at RubyConf 2024 for Glimmer DSL for LibUI (and other Glimmer desktop gems) is providing an editor that can update the GUI live as the programmer types code into it. I have built something like that before for a programming language for kids called DCR actually: https://andymaleh.blogspot.com/2024/12/the-dcr-kids-programming-language.html
How does Kamal deploy to multiple hosts?
Learn about Kamal multiple-server deployment in this short post.
State of Hanami, December 2024
Everything we did this year, and what we’re looking forward to in the next. A new kind of update! https://hanamirb.org/blog/2024/12/10/state-of-hanami-december-2024/
Montreal.rb Hack Night Solutions for Hunt The Wampus
In November and December of 2024, Montreal.rb hosted 2 Ruby Hack Night meetups about building the historic computer game, Hunt The Wampus, which was a text-based adventure game developed by Gregory Yob in 1973. Solutions have been released, which include the Ruby code for the Model layer, a desktop GUI View layer, and a Rails Web Frontend View layer: https://andymaleh.blogspot.com/2024/12/montrealrb-hack-night-solutions-for.html
Secure custom domains with Caddy
If you want to host custom domains for customers in your SaaS, you’ll need to handle both DNS and SSL. Fortunately, Caddy can help with both. Read this article to learn how.
Join and share your code snips
CodeSnips is a new project running on the THH #tailwindcss / #htmx / #hyperscript frontend on top of the #rubyonrails. Check it out here: https://codesnips.io/1-search-users-on-keyup-in-rails-with-htmx - join and share your code snips!
We upgraded our Open Source Job Board App (DollarJobs) from Rails v6.1 to v7.0.0
Upgrading Rails versions in any app require significant code refactoring and effort. Nonetheless, the effort put definitely takes your application towards much better security and maintenance. We upgraded our Open Source Job Board App (DollarJobs) from Rails v6.1 to v7.0.0 to incrementally upgrade it to Rails v8, soon. Read the process here - https://blog.railsforgedev.com/upgraded-our-open-source-job-board-app-dollarjobs-from-rails-version-61-to-700. Watch the Screencast here - https://www.youtube.com/watch?v=xthTdFdc_uk. View the Git Diff here - https://github.com/bestwebventures0/dollarjobs/compare/main…upgrade_to_rails_700. Fork the Repo here - https://github.com/bestwebventures0/dollarjobs/tree/upgrade_to_rails_700.
How to use Solid Queue for background jobs
In this video lesson, I show how to use Solid Queue with Active Job to send order confirmation emails in an ecommerce app. Solid Queue is the new default way of running background jobs in Rails 8 apps.
Applied Test Case Design: A Zammad Example
I wanted to show what does it mean to apply systematic test case design and used a piece of code from Zammad Rails open source app.
Multi-Gem Monorepos
Wrote https://terminalwire.com/articles/zeitwerk-and-versioning-for-multi-gem-monorepos to look at how I broke apart the Terminalwire gem into a client, server, and core gem. I explore the topics of versioning, name spacing, and how to use Zeitwerk to autoload the core and peripheral gems.
Fixing Gem Install Errors on M3 Mac with Ruby 2.7
Resolving some gem installation issues on modern Macs when setting up a legacy Rails project. https://danielabaron.me/blog/fix-gem-install-errors-m3-mac-ruby-278/
Overriding methods in Ruby on Rails - a no-code editing approach
Discover how to override a class or instance method without editing its source file in Ruby on Rails. https://allaboutcoding.ghinda.com/overriding-methods-in-ruby-on-rails-a-no-code-editing-approach
New updates to Everyday Rails Testing with RSpec
Hi Ruby friends, I’ve added a new chapter on request specs to Everyday Rails Testing with RSpec! Head to Leanpub to get your update now or purchase a copy of the book. Next up is a fresh take on system specs, now in progress. Thanks!
Implementing new EU invoice format (which is required for B2B from 2025)
From 2025, all B2B invoices within European Union must be machine readable by complying to a XML-spec (Factur-X).
In this post, I use secretariat
Gem for generating + validating the XML and then use plain Ghostscript to put it together with the original invoice.pdf into a hybrid so-called ZUGFeRD file that complies with the spec but still displays as a normal PDF(/A3). [more inside]
What you need to know about SQLite
Lessons about what the SQLite database engine can and cannot do, how Ruby on Rails helps you work with SQLite, and why it may, or may not, be a good choice to back your Rails 8 app. [more inside]
Kamal Database Backups
In this episode, we look at some precautions we can take with our production environment and setup recurring backups for the database. https://www.driftingruby.com/episodes/kamal-database-backups
Mastering Concerns in Ruby on Rails
Deep dive into Concerns in Ruby on Rails, exploring its role in modular code, comparison with Mixins, security, testing, and its use in Rails 6 and 8. Read it here - Mastering Concerns in Ruby on Rails.