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.
Upgrade Ruby, find a bug
Some notes on finding a bug as a result of a Ruby upgrade. OpenSSL, Ruby 2.4.0, dotenv, all that.
yield default object
A pattern for passing object with default values for the caller to change only some parts of it. We often use it in testing.
How to deal with technical debt?
I have shared my approach about How to deal with technical debt? [more inside]
Code refactoring - The when, the why and the who
A brief blog post explaining basic concepts about code refactoring, who should be doing it, why and in which cases. [more inside]
Airbrake: show unique error ids to speed up support
Instead of letting users explain how and where they got an error, let them tell you “I got error number 123423423424” and then simply open up all the details in airbrake with airbrake-user_informer
PolyBelongsTo reaches 1.0.0!
After two years PolyBelongsTo has its 1.0.0 release! PolyBelongsTo allows you to access model relations with ActiveRecord in a more across-the-board meta-programming friendly way. It includes database model relation integrity checking, deep nested relation cloning of model records, and plenty of nifty simplifications for your database relations. See PolyBelongsTo.
How to Read Ruby Documentation
Beginners use tutorials while experienced programmers read and refer to documentation. But how do you do that, exactly? This post explains the anatomy of a Ruby doc to help expand your understanding of Ruby: http://www.rubyletter.com/blog/2017/02/15/how-to-read-ruby-documentation.html
Using Rails Admin with a Rails 5 API application
A followup to my previous article on adding Active Admin to a Rails 5 API. This time we’re using Rails Admin which is even easier than before to setup. - http://www.carlosramireziii.com/how-to-use-rails-admin-with-a-rails-5-api-application.html
Rails Optimization: Introduction to cache
Need to speed up your website’s performance? This article will introduce you to the basics of caching in Rails applications. - https://prograils.com/posts/rails-optimization-introduction-to-cache
How to grow your own web development framework from Rack (4 part series)
The 4 part series will cover what Rack is, how to use it to handle incoming requests, how to use templating techniques to return a response, and finally, how to extract common code to plant the seeds for your very own web application development framework. [more inside]
Testing Ruby's Unicode Support
To see how far Ruby’s Unicode support has come, I tested every string method to see which ones violate the principle of least surprise. The results are presented as a handy table that you can reference to see which string manipulation methods are Unicode-unfriendly. - http://blog.honeybadger.io/ruby-s-unicode-support/
gem "general_time"
Allows getting general time between two instances of Date/Time classes https://github.com/bogdanvlviv/general_time
Upgrading a Ruby on Rails application
Reasons on why you might want to upgrade your application may vary case by case. It might not be driven because of business needs but primary due to technical needs or concerns. [more inside]
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