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 ancestor chain in Ruby
The ancestor chain is the representation of the class hierarchy in Ruby. https://www.rubycademy.com/screencasts/12
How to Recover from API Downtimes and Errors
APIs are stable, until they aren’t. We talk about that often at Bearer. If you control the APIs, it gets easier, but with third-party APIs and integrations it can be more difficult to predict when an outage or incident is about to happen.
Extract Key or Value From Hash in Ruby on Rails
Want to extract key or value from hash in Ruby on Rails? Here is the tutorial showing the easiest process to extract key or value from hash in detail. Post Link - https://thedevpost.com/blog/extract-key-or-value-from-hash-in-ror/
graphql_activerecord_autoselect 1.0.0
Automatic ActiveRecord column selection for GraphQL (Ruby) fields. https://github.com/mrrooijen/graphql_activerecord_autoselect
attr_encrypter 1.0.0
Encrypts/Decrypts, with key rotation, attributes on classes, using RbNaCl (libsodium). https://github.com/mrrooijen/attr_encrypter
Messages in Ruby
In Ruby, a message consists of a name, usually represented by a symbol, and an optional payload. https://www.rubycademy.com/screencasts/20
til-rb a ruby gem to help you manage a GitHub repo of TILs
til-rb is a ruby gem I recently published, it helps you maintain a repo of TILs, inspired from https://github.com/jbranchaud/til [more inside]
Selectively track changes made on your ActiveRecord models.
Hi, i’ve made a gem to selectively track changes on AR models, where audited gem would be an overkill. [more inside]
Build A Saas App in Rails 6 book has launched!
I’ll spare you all the the marketing talk in this description, but the book has launched! [more inside]
More Descriptive Flipping
Flipper 0.18.0 now with new lipstick on a pig and descriptive descriptions. Read more on my blog if you dare: https://johnnunemaker.com/more-descriptive-flipping/
The Secret Sauce of Hassle-Free SPAs
I’d been a happy Ruby on Rails developer for years when I started playing around with SPAs. Server-rendered HTML with sprinkles of jQuery worked well for most of my projects, but some parts were getting too complex. That’s when my React journey began. [more inside]
HereDocs tokens as method argument
An overview of how to interact with HereDocs as method arguments https://medium.com/rubycademy/heredocs-tokens-as-method-argument-8fe3ed723d96
Troubleshooting Encoding Errors in Ruby
Text encoding is fundamental to programming. Web sites, user data, and even the code we write are all text. When encoding breaks, it can feel like the floor is falling out from under you. You’re cast into a dimension of bitmasks and codepoints. Logs and backtraces are useless. You consider trading your text editor for a hex editor. But there’s hope! In this article, Jose Manuél will show us how encoding errors happen, how they’re expressed in Ruby, and how to troubleshoot them. So the next time one of these errors lands on your desk, you’ll be in a better position to handle it. https://www.honeybadger.io/blog/troubleshooting-encoding-errors-in-ruby/
Introducing UndercoverCI
A GitHub code review app that analyses pull requests and finds untested methods you’ve changed: https://medium.com/@mrgrodo/introducing-undercoverci-98c6c50793f2
Advanced Active Record: Using Subqueries in Rails
Real-life examples of business needs translated first into SQL, then into the Rails code necessary to find those records: Advanced Active Record: Using Subqueries in Rails
Multiple Foreign Keys for the same relationship in Rails 6
Here I shared my experience with personalized migrations [more inside]
Don't blindly apply software patterns
I share my comments to the typical sagas & process managers examples and why blindly following software design patterns is not the best idea. Patterns are not the silver bullet, do not apply them without considering your domain and real intentions of the users. What’s the solution? Read more here: https://blog.arkency.com/dont-blindly-apply-software-patterns/
Django vs Ruby on Rails Comparison: Web Frameworks Performance and Popularity
A perfect and reliable Django vs Ruby on Rails comparison for two popular web development frameworks for your next application. Read our comprehensive guidelines for Django vs Rails. [more inside]
Simple Code
To make meaningful progress, you have to get things done. To increase the rate at which things get done, you have to make doing easier. [more inside]
Beautiful, fast server-rendered apps with Rails and StimulusJS
This post shows how to use StimulusJS, RailsUJS and server-rendered HTML with built in transitions and DOM manipulation: https://www.thecrapthatcomesoutofmyhead.com/2020/06/24/building-beautiful-fast-apps-with-rails-and-stimulusjs/
A simple gem for dealing with side effects
This gem makes it easy to create commands that keep track of side effects. If an error happens then each command can be undone again. https://github.com/sammyhenningsson/file_transactions
ExceptionNotification v4.4.1 is out 🚀
v4.4.1 has just been released! It includes some enhancements to ignore exceptions, and more data for Mattermost notifier. https://rubygems.org/gems/exception_notification/versions/4.4.1
Rails architecture tips from route helpers
A subtle feature of named route helpers gave me a new appreciation for the attention to detail that the authors of the Rails framework put into making it a pleasant development experience: Rails architecture tips from route helpers