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.
BatchLoader: Kill Your N+1 Queries
I created a gem BatchLoader – an adapted Ruby implementation of battle-tested tools like Haskell Haxl and JS Dataloader. I believe that every Ruby developer should know about batching as a technique which helps avoid N+1 queries ✌️
Ruby on Rails with Visual Studio Code
I wrote an article on how I use Ruby on Rails with Visual Studio Code, after switching from Atom recently.
Yard-Junk: getting rid of junk in your YARD docs
Yard-Junk is a new YARD plugin/patch, that provides structured documentation error logging and documentation errors validator, ready to be integrated into CI pipeline.
[Screencast] ActiveRecord Migrations
This episode covers different tips and tricks around database migration files. https://www.driftingruby.com/episodes/activerecord-migrations
5 Years of Professional Ruby and Rails Development - My Reflections
As hard as it is for me to believe, I already have over 5 years of professional experience in Ruby and Rails. Throughout all these years my attitude towards Rails has been fluctuating between going from blind love to harsh critic (ActiveRecord, I’m looking at you) ending with a bit more balanced but certainly a positive approach. Such time is long enough to have a meaningful opinion about the overall experience using any framework, so here are few points about Rails that I would particularly like to focus on in my reflections. [more inside]
Tutorial on how to integrate a Third Party API using Rails 5
Learn how to do a Third Party API integration in Rails 5 using Faraday. https://revs.runtime-revolution.com/integrating-a-third-party-api-with-rails-5-134f960ddbba
Best practices for building a Rails admin interface from scratch
Active Admin is great for quickly rolling out a simple CRUD interface to manage your app’s data, but sometimes you need something more customized. If you are considering building an admin panel from scratch, be sure to follow these best practices or you might regret rolling your own down the road. http://www.carlosramireziii.com/best-practices-for-building-a-rails-admin-interface-from-scratch.html
beer.db.starter Sample - Build Your Own HTTP JSON API (w/ beerd.db)
Hello, I’ve updated the beer.db web service starter sample that gets you started building your own HTTP JSON API using the beer.db (and friends). What’s news? The starter sample now uses the new webservice library (a simplified sinatra 2.0-style library for HTTP JSON APIs). Enjoy. Cheers. Prost.
Translate your ActiveRecord attributes without stress or bloat
In this article you’ll see how easy it is to provide translated attributes in your ActiveRecord records without relying on external librairies thanks to native JSON fields.
Rails Custom Loggers
Custom loggers are useful if you wish to have a separate log file for different moving parts of your Rails application. This would make your logging more efficient and readable. (Eg: a file to record all the API request you received). Let’s have a look on them! [more inside]
Generate an application with a specific Rails version
Two simple ways we can generate rails app with specific version: https://www.sharmaprakash.com.np/rails/generate-an-application-with-a-specific-rails-version/?utm_source=rubyflow&utm_medium=post&utm_content=version-specific-rails-app
Timber Gem - My solution to Ruby's hard to use logs
Hi everyone! You might remember from me from my Authlogic days, I’m really excited to share Timber with you. A thorn in my side has always been Ruby logging. Logs are essential for insight, but oh how I hate hated using them. Timber is my solution. Highlights: logrageify option, integrates with rails/sinatra/hanami, support for context & structured data, tail users. I’d love feedback on it.
Autocorrect with Postgres Trigrams
Did you know Postgres can provide spelling suggestions? Here’s how to use pg_trgm to auto-correct search queries in a Rails app.
Introduction to Concurrency Models: Processes, Threads, GIL, EventMachine, Fibers
In the blog post, I describe the differences between Processes, Threads, what the GIL is, EventMachine and Fibers in Ruby. When to use which of the models, which open-source projects use them, what the pros and cons are. https://engineering.universe.com/introduction-to-concurrency-models-with-ruby-part-i-550d0dbb970
A Quick Analysis of How Sinatra Works
What can we learn from reading Sinatra’s source code? What interesting tips & tricks can we discover? http://www.blackbytes.info/2017/08/how-does-sinatra-work/
How to make AJAX calls in Rails 5.1
Learn how to make AJAX calls in Rails 5.1 using rails-ujs, jQuery or axios. Rails 5.1 shipped without jQuery as a dependency, replacing it with its own library rails-ujs for Unobtrusive JavaScript features. There are a few changes in the way you do AJAX calls, including things like data formats and CSRF tokens. This short article will bring you up to speed.
webservice gem - yet another HTTP JSON API (web service) builder (in 100 lines)
Hello, I’ve put together a webservice gem - yet another Sinatra-style HTTP JSON API builder (in about 100 lines of ruby). Why? Why not ;-) The main “innovation” is easy dynamic loading of services e.g. use Webservice.load_file() to get a ready-to-use web services (rack) app. Cheers. PS: Inspired by Almost Sinatra (Sinatra in 6 lines of ruby) and New York, New York, Nancy, Rum, Cuba, and other Sinatra-like micro libraries.