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.
The Arguments Forwarding shorthand in Ruby 2.7 🤩
How to 3-dots operator can be used to automatically forward arguments to another method call rubycademy.com/arguments-forwarding-shorthand
Russian Production Calendar (1997 - 2025)
Working days calendar of Russia, ruby gem by Open Data Portal © Russian Ministry of Economic Development
Annotating Rails models using the Annotate Gem
You can use the annotate gem to get a summary of the Active Record schema at the top of relevant files (models, controllers, fixtures).
Gladiator (Text Editor Fully Written in Ruby) Finally Gets Colors!
Gladiator (short for Glimmer Editor) is a text editor fully written in Ruby as an exercise in using Glimmer DSL for SWT. It was declared the Ugliest Text Editor Ever on reddit. Sadly, it might no longer hold that title since it just got colors with Ruby Syntax Highlighting. Check it out at GitHub:
flow-lite gem - lite workflow engine; let's you define your workflow in Flowfiles
Hello, I have bundled up in the flow-lite gem - a lite (lightweight) workflow engine that let’s you define your workflow steps in Flowfiles (in ruby) and includes the flow command line tool. The original itch / need / inspiration was / is the use in GitHub Actions (Workflows). Happy automating with ruby. Cheers. Prost.
Rails: Grouping The Records By Date Using Enumerable#group_by Method
Here is the simple example which uses the group_by method to group records by it’s created_at date differentiating today’s messages with other days’ messages.
Understanding differences between create_or_find_by and find_or_create_by
It is important to know the expected usage of an web endpoint when picking between Activice Records helper create_or_find_by or find_or_create_by. Know the DB interactions that best fit your needs and how one implementation could be up to 4X faster depending on your needs.
Software Engineers are basically Carpenters
Do you know, software engineers are basically carpenters. This analogy will help you to boost your productivity. Read more here:
Implementing Jekyll blog
This year I migrated my blog over to Jekyll, a Ruby static site generator. If you are thinking about setting up a new Jekyll site, I wrote Migrating WordPress blog to Jekyll with a lot of tips.
Introducing Stimulus components
Stimulus Components is a set of Stimulus controllers with a first class support of Rails. [more inside]
Splitting Rails migration into smaller pieces
If the table is huge and such a migration takes a lot of time, it sounds natural to split it into smaller pieces and run them without locking the table. See some thoughts about this approach here:
Track User Events and Visits in Rails using Ahoy GEM!
There could be other such use-cases where we need to use the data available from such third-party service and acquire some new parameters.
Shortest Ruby Syntax Highlighting Implementation with Glimmer
Glimmer DSL for SWT 4.17.4.0 ships with a number of changes, such as the new code_text syntax highlighting custom widget, the Glimmer Meta-Sample (The Sample of Samples), and the Hello, Sash Form! Sample. One noteworthy thing to mention about implementing code_text is that with Glimmer Ruby syntax, it was the shortest Syntax Highlighting implementation of SWT StyledText I have ever seen compared to various resources online.
Rails API: be nice to your clients
A collection of tips and tricks (with code!) to write smart and nice APIs in Ruby on Rails. [more inside]
Truemail 2.0.1 has been released 🚀
Fixed smtp-requests behaviour, released developers documentation 📚 Be sure that email address valid and exists 📨
Implementing fastlane in 50 lines of code
Thousands of mobile developers use the fastlane gem and its DSL on a daily basis, but only a few understand that they’re writing Ruby. This post shows how you can recreate the main concepts of Fastlane in 50 lines of Ruby. [more inside]
Sane Excel file generation with Ruby on Rails
Read about 3 steps we took to reduce our memory footprint (0.2Gb instead of 4Gb) and the time when generating Excel reports (2m instead of 15m). [more inside]