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.
Writing a one-time script in Rails
Have you ever wanted to import a bunch of data into your app from a CSV file? Or maybe you need to fix badly encoded characters in some of your customer reviews. These are “ad-hoc tasks.” As in, you probably only need to run them once. So what’s the best way to handle an ad-hoc task in Rails?
Hanami v1.0.0.beta1
Feature freeze, automatic logging for HTTP requests and SQL queries. Final release by the end of March. http://hanamirb.org/blog/2017/02/14/announcing-hanami-100beta1.html
26+ New Themes - Dr. Jekyll's February '17 Edition - Midnight, Merlot, Bootflat, etc.
Let’s welcome the February’17 Edition of the Dr. Jekyll’s Themes of the Month series that highlights ready-to-fork (or ready-to-bundle) static (web)site themes. New themes include: Console by Jae Hee Lee, Emping by Rahmat Subekti, Papyrus by Hugo Sereno Ferreira, Alembic by David Darnes, Whiteglass by Chayoung You, Architect (Pages) by Jason Long, Dinky (Pages) by Diana Mounter, Hacker (Pages) by Jason Costello, Leap Day (Pages) by Matt Graham, Merlot (Pages) by Cameron McEfee, Malt (Cloud Cannon) by Mike Neumegen, Urban (Cloud Cannon) by George Phillips, Schemadoc by Gerald Bauer, Octopod’s Bootflat by Stefan Haslinger, and many more. Find all themes at the Dr. Jekyll’s Themes directory. Any theme missing? Add your theme! Happy Publishing with Jekyll ‘n’ friends. Cheers.
Introduction to Fixtures for testing
Fixtures are one of the important thing in Rails testing. Testing the application helps to debug it more efficiently and ensures the desired functionality to the application. Let’s have a look on them. http://blog.redpanthers.co/rails-test-fixtures/
The right amount of tests with Test Pyramid
How many acceptance tests, integration tests, unit tests do you need to write in order to keep you app healthy? Test Pyramid might be the answer: http://blog.primehammer.com/2017/02/14/test-pyramid/
How to test a React app using capybara-webkit
After working on a Rails app with a React frontend, I wrote about some of the problems I faced when testing it using capybara-webkit, and how to solve them: https://www.ombulabs.com/blog/rails/react/how-to-test-a-react-app-using-capybara-webkit.html
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
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! [more inside]
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. [more inside]
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: http://nithinbekal.com/posts/jenkins-rails/
Scalar: a thin, performant library for measurements
How thin? It is 168 loc. How performant? Check out the benchmark on Github. [more inside]
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? http://blog.katpadi.ph/autocomplete-with-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. http://phansch.net/2017/02/12/a-better-pry-prompt-for-rails-console
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/ https://medium.com/@kdiogenes/giving-super-powers-to-rails-nested-forms-with-vue-js-part-2-acee4a3ee43d#.q8hzslmw3
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. [more inside]
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. http://blog.redpanthers.co/ruby-irb-console-improvements-irbtools/