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.
Rails Monolith towards Engines spike - The experience of a ten-people team
Why we settled on keeping a Rails monolith, instead of going for separation using Rails Engines. https://withatwist.dev/our-rails-engines-spike.html
The Complexity of Active Record Transactions
A critical dive into the implementation differences of database transactions between Active Record and Sequel. https://janko.io/the-complexity-of-activerecord-transactions/
Upload files to Amazon S3 using Active Storage with Securely Storing Credentials
Rails 5.2 comes up with inbuilt feature called Active Storage for the same purpose i.e File uploading which is much simpler than existing options. https://www.botreetechnologies.com/blog/rails-5-2-upload-files-to-s3-with-active-storage-rails-5-2-credentials
Tracking PaperTrail versions while saving in batches
The article explains how to efficiently track and query PaperTrail versions while saving multiple models in batches. https://veelenga.github.io/tracking-paper-trail-versions/
Reading gems’ source code
I regularly use the command “bundle open” to understand how a gem works. This article explains how/why I use that command. https://www.marionzualo.com/2020/09/27/reading-gems-source-code/
Radio Selection Unselect with Stimulus.js
I recently found myself wanting to be alerted on an unselect action so that I could change what was displayed on the page. A small Stimulus controller that waits for the selection event, and emits its own event that other radio button controllers will receive was the perfect solution! https://onrails.blog/2020/09/25/radio-selection-unselect/
My Website Relaunch
I just published a story about how I lost my website domain, what was happened with it and how I have relaunched my website. https://medium.com/@mayurt20/how-i-have-relaunched-my-website-bb63412c2c03
Sort Rails Records Using Enum Value
Learn more about how to sort records in custom order by enum value in rails. Contact us to build web and mobile app to add value to business. https://www.botreetechnologies.com/blog/how-to-sort-records-in-custom-order-by-enum-value-in-rails
Managing Bundler and Rubygems with Ansible
If you use Ansible for your Ruby setups, and want to install and freeze Rubygems and Bundler, this will come handy.
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, https://www.business2community.com/ecommerce/why-ruby-on-rails-is-perfect-for-ecommerce-web-development-in-2020-02347634
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
https://andymaleh.blogspot.com/2020/09/bundler-download-plugin-post-gem.html
How to Build Blog with Ruby on Rails (Part 6)
Authentication in Rails application by Devise https://fullstackrubyonrails.com/blog/authentication-in-rails-application
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.