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.
13 tips to write better Rails code
Writing clean code is the key for maintainable and sustainable code. [more inside]
ActiveWorkflow 0.9.10 is out, with an official Docker image
Starting with this release we are publishing official docker images for ActiveWorkflow to DockerHub. Now you can start using ActiveWorkflow without ever touching the source code repository (unless you want to). [more inside]
Kiba ETL v3.5.0 is out (with Ruby 2.7+ support)
I’m happy to announce Kiba v3.5.0 and kiba-common v1.1.0. [more inside]
Resize and optimise images on upload with ActiveStorage
I wrote a a post on how I optimise images uploaded with ActiveStorage by reducing resolution and applying some compression optimisations. The result is a smaller file without sacrificing much in quality. [more inside]
Enforce code boundaries in Rails apps with Packwerk
Packwerk is a Ruby gem created at Shopify that can be used to enforce boundaries and modularize Rails applications. Try it out yourself by running packwerk init in the application after installing it.
Heroku features that I didn't know about
Might not be 100% ruby related, but since a lot of us here use Heroku I though I would share some recent things I’ve learn about the platform. I’ve been using Heroku for years, and still manage to, somehow, miss the new features announcements.
tty-editor v0.6 is out!
The latest tty-editor supports opening multiple files, searches more editor commands and adds configuration options like :raise_on_failure to make it even more flexible. Enjoy!
Taptag: Ruby interactions with NFC and Raspberry Pi
A Gem for working with Waveshare’s PN532 NFC HAT for Raspberry Pi. Wraps C code for quick execution, and comes with extras to get you started with it out of the box. Read about it on my website or check out the code on GitHub
Why Ruby on Rails is Perfect for eCommerce Web Development in 2020
Ruby on Rails is one of the web development frameworks for building web applications. Even though Ruby on Rails has reached its maturity,
bundler-download
The RubyGem ecosystem, famous for gems like Rails for web development, Devise for authentication, and Pundit for authorization, enables productivity via code reuse. As such, it is great for quickly adding libraries to your project to automate part of the work or reuse other people’s solutions to solved problems. That said, you wouldn’t want to package extremely large files like the OpanAI 1GB+ files in a RubyGem. Enter bundler-download, a Bundler Plugin that enables downloading extra gem files after installing with bundle install by declaring gem downloads in a Downloadfile
How to Build Blog with Ruby on Rails (Part 6)
Authentication in Rails application by Devise
Truemail 1.9.1 🚀 supports MRI Ruby 2.7.x+ syntax
Added compatibility with Ruby 2.7.x syntax. Also added new Truemail developers docs 📚 with a lot of usecases. Be sure that email address valid and exists. https://github.com/rubygarage/truemail
Testing for Errors without Side–Effects in RSpec
A simple way to write RSpec tests that assert an exception is raised and changes are rolled back.
Refactor your switch statements with case_register
case_register is a gem that provides a design pattern to manage switch statements by mapping each case to a method which is dynamically defined in advance.
Modern Rails flash messages (part 2): The undo action for deleted items
Easily allow users to undo removing of deleted items using modern Rails flash messages with the undo action. The second part of the tutorial with full code on GitHub and live demo.
Tracking All Paper Trail Version From A Single Request With Correlation UUIDs
If you’ve ever had a need to implement an audit log to track all the changes that get persisted for all or at least some models in your application, there is a good chance that you’ve encountered PaperTrail gem that makes it trivial to track all the changes - it might be as easy as adding has_paper_trail to the desired models. [more inside]
Writing a background job processing using Ractor
How to use Ractor the new concurrency primitive to build a simple background job processing [ READ MORE ]
The Hidden Costs of Software Dependencies [YouTube]
I take a 10-year perspective on my Rails application and look at how Ruby and JS dependencies contributed to maintenance costs:
The Data Cascade, Find Tag, and More in Bridgetown 0.17
We’re pleased to announce the release of Bridgetown 0.17, codenamed “Mount Scott”. Some of the improvements are optimizations at the code level and preparing for bigger features down the road (i18n), but there are also a few goodies you can start using in your static site projects today.
Glimmer Has Been One Point Oh’ed!
Glimmer is finally 1.0.0. This marks a big milestone since Glimmer has outgrown its single-library roots and has become an assortment of Ruby gems that work together, such as Glimmer DSL for SWT (JRuby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Desktop Development GUI Library), Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.