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.
Reading Ruby Code: ROM - orientation
Reading Ruby Code is an on going series on code reading that explores the ROM library. In this post we examine how to begin code reading and orienting ourselves to a new project
Unicorn vs. Puma vs. Passenger: which app server is right for you?
The Ruby app server ecosystem has consolidated around three app servers in 2017. I compare and contrast Unicorn, Puma, and Passenger and talk about ideal use cases for each.
[Screencast] Decoding and Interacting with Barcodes
Using the QuaggaJS Library, learn how to scan and decode barcodes with your Ruby on Rails application. Using provided callbacks, interact with controller actions to provide a seamless experience. https://www.driftingruby.com/episodes/decoding-and-interacting-with-barcodes
The Lego Way of Structuring Rails Code
Blog post about The Lego Way of Structuring Rails Code
GoF design patterns in Ruby
In this repo I wrote a summary of the design patterns explained in the book Design Patterns in Ruby, where Russ Olsen explains and adapts to Ruby 14 of the original 23 GoF patterns.
ActiveHashRelation reaches 1.4.0 with many new features.
ActiveHashRelation, a gem that allows you to run queries from an API that uses only Hashes, reached version 1.4.0. From Version 1.0 there have been many improvements and extended test coverage. Many features have been merged in the past 2 months, among others:
jQuery Tag-it - Integration with rails
jQuery tag-it is an excellent jQuery UI plugin with auto-complete support. This blog explains steps to integrate it easily with a rails app! Read more
Learn how to DRY out your RSpec tests with Shared Examples
Checkout my latest article where I explain How to use shared examples to DRY out test suit and bring consistent structure for designing APIs: How to DRY out your RSpec Tests using Shared Examples. Read more
Pronto v0.8.0 released!
Pronto keeps getting better at providing a quick automated code review of your changes. Check out the CHANGELOG for the list of features/changes/fixes of this release.
Setting Up Jenkins on Ubuntu 16.04 for Ruby on Rails CI
If you’re looking to set up a CI server using Jenkins to run Rails tests, here’s a quick how-to for setting up a Digital Ocean droplet with Jenkins:
Scalar: a thin, performant library for measurements
How thin? It is 168 loc. How performant? Check out the benchmark on Github. Read more
Autocomplete Using Redis (Basic)
Usually, when we implement suggestions in autocomplete input fields, we query directly to our database. Relatively, LIKE queries in MySQL are slower. So why not autocomplete using Redis?
A safer Pry prompt for the Rails console
A quick way to make your everyday work with Ruby on Rails a bit more safe with an improved rails console prompt.
Giving super powers to Rails nested forms with Vue.js — Part 2
Finished my quest in giving super power to Rails nested forms with Vue.js! All bugs smashed \o/
How to dynamically add attributes to your ActiveRecord models
Sometimes we need to build an application that has domain models that we don’t know all the attributes of. A good example of such application is a system for tracking business contacts. In the center of it is a Contact model that has attributes like name, email, phone number, etc. But can we know beforehand all the attributes that our Contact model will need to have? If we want to create the application for a wide audience, it can be difficult to predict. Solution? Allow users to add more attributes to Contact model in the runtime! We’ll do exactly that in this tutorial. Read more
Store different kind of actions in one table
Store different kind of actions (Like, Follow, Star, Block …) in one table via ActiveRecord Polymorphic Association. ActionStore
Decorators, are we really decorating well? or using a tooth brush to paint a room?
After a little interest in my latest gem, I wrote a little piece to add to the design patterns in Rails conversation. A small blog about decorators in Rails and why I steer well clear of draper and other implementations. As well as an introduction to my own implementation of the decorator pattern, bottled_decorators.
Bringing more life to the irb
If you want to bring more life to your irb console then have a look at this. Irb can be made to do more things that you originally imagined.
A better way to import all your records using ActiveRecord Import!
Ever suffered through importing lots of records using ActiveRecord ? If so, this post is for you!
An alternative to Rails before_action
Thoughts on best practices for filters in Rails controllers and the search for an alternative to the not proper uses of before_action.
Integrate Rubocop gem with Popular (Ruby) Text Editors
Integrate rubocop(A Ruby static code analyzer) in popular text editors Sublime, Atom, Vim, Visual Studio Code and RubyMine Read more
Testing multithreaded ActiveRecord code with transactional fixtures
ar multi threaded transactional tests gem synchronizes transactions and db queries, so testing multithreaded code works with transactional fixtures.
Distinct Active Records in has_many through associations
A quick reminder on how to load only distinct collections into Ruby on Rails models with has_many through associations.
Introducing our Sidekiq cluster script
Here’s an easy way to run multiple Sidekiq processes via systemd: http://blog.honeybadger.io/introducing-our-sidekiq-cluster-script/
Animated Turtle Graphics using PDF
After seeing one of Jamis Buck’s weekly programming challenges being the implementation of a turtle graphics system, I decided to tackle this one using HexaPDF as backend. It turns out that animated turtle graphics are still more fun!