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.
When NullObject Meets ActiveRecord
Here’s a gem called SafeFinder. It helps you building model’s Null Object, and whenever your finder methods get nothing, it returns your Null Object instead of nil or raises exception.
Command Line Reporter 3.3.6 Released
Fixes an issue with New Relic installs. Check out the wiki to see examples of nicely formatted tables. As always the gem is available on rubygems.org with source on github. For those not familiar with “the reporter”, it provides a ruby DSL for writing reports with built in features for progress reporting and table formatting. It is very handy for system level and data reporting scripts.
Ruby 2.2.3 Hash Basics : Part 3
Ruby 2.2.3 hash methods such as assoc, key, any?, default and compare_by_identity?. Watch the video here
Using ES6 with Asset Pipeline on Ruby on Rails
Using ES6’s features today is a viable option. And you don’t even have to use builders like Gulp or Grunt. Learn how to integrate Babel.js with Asset Pipeline in this article.
Ruby 2.2.3 Hash Basics : Part 2
Ruby 2.2.3 hash methods such as default, ==, upcase and try_convert is covered in this video
Elasticsearch gems and modules, clearly explained
Ever since the official Elasticsearch tire gem has been split into multiple gems, it’s been unclear to me what they all do. So I wrote this to help understand their responsibilities: http://hakunin.com/elasticsearch-gems
Exploring the new Turbolinks 3 features with Rails
I did a live coding stream checking out the new Turbolinks 3 features.
Sanitizing html input: youtube iframes, css inline styles and customization
Sometimes we give users tremendous power over the content generated on the web platforms that we write. The power to add content using HTML/WYSIWYG editors. There is only one gotcha. We need to make sure that this power is not abused by malicious users. After all, you are a responsible developer, right? [more inside]
Ruby 2.2.2 Array Basics : Part 9
Ruby 2.2.2 Array methods such as pack, permutation, pop, product, push, rassoc, reject and repeated_combination. Watch it here
How to run Kiba ETL in a Rails environment?
Tonight I spent a bit of time documenting how you can get access to your Rails environment from inside a Kiba ETL script, including ActiveRecord models, database connection etc. Hopefully this will make it easier for you to add data-processing tasks to your Rails app using Kiba.
Parse *.gemspec file
CLI for parsing *.gemspec file. Convert to JSON format. parse_gemspec-cli. Parse *.gemspec file. Convert to Plain Old Ruby Hash Object. parse_gemspec.
Why you should use Rails for your new company
A rebuttal to the “Why I wouldn’t use Rails for a new company” article http://www.bootstrap.me.uk/bootstrapped-blog/why-you-should-use-rails-for-your-new-company
warden-github-rails
warden-github-rails allows you to use GitHub as authorization and more. Use organizations and teams as means of authorization by simply wrapping your rails routes in a block. Also useful to get a user’s details through OAuth.
Unemployed Rails developer? No problem
You’ve learned Rails, but nobody will hire you? Here’s an exact guide to solve your “no professional programming experience” problem once and for all. And become a freelance Rails developer.
Building JSON APIs in Rails 5 today!
An article I wrote about building JSON APIs in Rails 5… today! How you can try out Rails 5 using the new –api version, which gives you a scaled down, API specific version of Rails functionality. This article also covers some caching and middleware request throttling.
Respect HTTP Caching
An article about utilizing HTTP caching and how it works, especially for your JSON APIs. How Last-Modified and Etags work along with some benchmarks showing the speed improvements.
Seattle.rb Weekly Ruby Quiz - BrainCandy
We post one question a week. Solve them in any language you want, but of course we’re biased and love to see ruby. [more inside]
Localized cache store in Rails
If you cache localized views in your Rails app, consider including I18n locale into the global cache key. In my post, I describe how to do it without monkey patching existing Rails cache stores. http://blog.iempire.ru/2015/09/14/localized-cache-store/
Monitor and analyze your Passenger apps today with Union Station
Union Station is Phusion’s brand new take on Passenger application monitoring and analytics. Union Station aims to help you easily find performance bottlenecks and errors in your application and to help you fix them. blog.phusion.nl/2015/…
JavaScript Debugging for Rubyists
Brief translation guide to help Rubyists discover the JavaScript equivalents of common Ruby debugging techniques https://eliotsykes.com/debug-js
Building Minimal Docker Image for Rails App
How to build minimalistic Docker image for Rails application: http://blog.kontena.io/building-minimal-docker-image-for-rails/
Rails Interactor Pattern - Part 2
This time I’m adding some helper methods to our interactor, which will make handling failure cases easier and more obvious. Here’s the link to part 2 or first catch up with part 1.
Sequel vs Active Record ORM Benchmark on PostgreSQL
In my machine Sequel has better performance than Active Record - http://www.railsmine.net/2015/09/sequel-vs-active-record-orm-benchmark-postgresql.html
XML or JSON API?
In lesson #4 of the Build Less, But Better Software email course, we looked at 5 ways APIs help businesses increase revenue. In lesson #5, we’ll look at technologies that go into delivering API, XML and JSON