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.
How to Integrate PayUMoney in your Spree Commerce Store with Ruby on Rails?
Want to know how to integrate PayUMoney in your Spree Commerce store using Ruby on Rails? Read this blog for step-by-step instructions. https://www.botreetechnologies.com/blog/integrate-payumoney-spree-commerce-store-with-ruby-on-rails
How to merge SimpleCov results on SemaphoreCI 2.0
SemaphoreCI is an up and coming bare-metal CI, I suggest you guys to try it out. Anyway here’s how to merge SimpleCov parallel test results with their workflow & job artifacts storage. [more inside]
Struct class in Ruby
I have tried to explore and put together all that could be useful about the struct. Follow: https://www.sandipmane.dev/struct-class-in-ruby
football-to-psql - load / read football.txt match datafiles into postgreSQL database
Hello, I have put together the football-to-psql tool that lets you load / read football.txt match datafiles (e.g. English Premier League, German Bundesliga, Spanish La Liga 2020/21, etc.) into a postgreSQL database. Example: football-to-psql england.db 2020-21\1-premierleague.txt Enjoy the beautiful game with ruby. Cheers. Prost. PS: Not a friend of PostgreSQL? Try the little brother / sister serverless SQLite variant, see football-to-sqlite.
ActiveWorkflow 0.9.11 is out, with numerous updates to the UI
This release brings numerous updates to the UI—better styling, improved visual consistency, and a brand new logo. Also, there are multiple other small fixes and improvements. See https://github.com/automaticmode/active_workflow for more. 🎸
Squash N+1 queries early with n_plus_one_control test matchers for Ruby and Rails
Discover the test-oriented alternative to detecting the N+1 query problem in your Rails and pure Ruby applications even before the redundant database calls manifest in your development. The n_plus_one_control gem works differently from well-known tools such as Bullet and makes sure that extra SQL queries never go unnoticed, independent of your ORM tool of choice.
Reloading Rails Partials on Demand with render_async
Refresh parts of your page using the new version of render_async. Read more about it in the blog post here https://pragmaticpineapple.com/reloading-rails-partials-on-demand-with-render-async/
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). https://cionescu.github.io/2020/10/24/using-annotate-in-rails/
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: https://github.com/AndyObtiva/glimmer-cs-gladiator
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. https://www.botreetechnologies.com/blog/rails-grouping-the-records-by-group-by-method
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: https://mayurkumarpatel.medium.com/how-engineers-are-basically-carpenters-9f1b3c38a511
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: https://veelenga.github.io/splitting-rails-migration-into-smaller-pieces
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. https://www.botreetechnologies.com/blog/ahoy-an-analytics-for-rails-track-events-and-visits
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.
https://andymaleh.blogspot.com/2020/10/glimmer-syntax-highlighting-text-widget.html