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.
Example Applications for Rails 4.2.4
Not a big deal, but I’ve updated the RailsApps Example Applications for Rails 4.2.4. I keep them up to date with the current release. More importantly, the ones that use the Gibbon gem (for MailChimp) are updated for Gibbon 2.0.
PostgreSQL for Ruby Developers
If you want to learn SQL and improve your database skills in general I just published the perfect book for you: https://gumroad.com/l/postgres
RuboCop 0.34 is out!
Apart from the usual myriad of bugfixes, improvements and new cops, this version introduces a results caching functionality. This functionality will speed up tremendously consecutive RuboCop runs on the same codebase. [more inside]
David Heinemeier Hansson Interview
DHH on Developer On Fire I interviewed David Heinemeier Hansson on my podcast. He was inspiring and had a lot of really amazing things to say and shared his very different outlook. I’d love to know what you think. It was fun speaking with him.
Save image as progressive image using paperclip and imageMagick
Otimizing images is one of the most important branch of the web optimization process. Images that are delivered by the web server to the client’s browser must be optimized in order to improve the page load speed and to offer a better user experience. It’s known that perceived speed is more important than actual speed. Read more here
Envlogic – gem to have a Rails.env like environment var behaviour in non Rails apps
Envlogic is a simple gem that will help you manage your Ruby application environment. Read more here
Testing race conditions in your Rails app
Only 15 people can subscribe to a course, only limited number of people can buy this physical or virtual product, only 200 people can go to a concert, etc. How do you test that this limitation actually work? And not only work but that it works under heavy load, when there are multiple customers trying to buy the last item because it is a hot event or the product is offered with a big discount? [more inside]
How can you avoid developing a monolithic Rails app?
Top Down Vertical Slice Integration
Creating Ruby enumerators on the fly
When you treat your collections as enumerators, you get to use all your favorite functions like #map and #reduce without having to write any extra code. In this post I show you how easy it is to create enumerators on the fly, without defining extra classes or messing around with the Enumerable module. http://blog.honeybadger.io/creating-ruby-enumerators-on-the-fly/
Grape API Throttling with Grape-Attack gem
Grape-Attack has your API endpoints covered. Grape-Attack is a middleware for Grape to add endpoint-specific throttling. Will also take care of setting custom rate limit headers for you.
Please use a favicon for RubyFlow
Please use a favicon for RubyFlow website http://www.rubyflow.com/
Protect your Rails app from PNG bomb attacks
A new Carrierwave plugin to check “real” image size bypassing ImageMagick (which may be fooled by a PNG bomb): https://github.com/DarthSim/carrierwave-bombshelter [more inside]
How to store and securely manage configuration options in Rails
Store secrets in environment variables, secure and manage them. I collected all information about the topic here: https://rorsecurity.info/portfolio/secure-configuration-of-rails-applications
Extending Pundit with dedicated policies
Pundit is a wonderful authorization library and it truly shines through the use of OOP and plain Ruby. However, when used with more than one or two user roles, policy objects can quickly become riddled with complex conditional logic. This article looks at how the basic OO concepts that underly Pundit can be put to good use to create dedicated policies per user role.
Colt Gem RubyCritic Analysis
RubyCritic is easy to use. Here is some stats for Colt gem: Code Metrics using RubyCritic gem
Announcing Ruby Fix 0.7!
After months of drafts, we’re proud to announce the release of Fix! [more inside]
Building a Ruby on Rails App Part 1: The app
We’ve built a real Ruby on Rails app that tracks sale ranking of Rails books on Amazon. And we’re describing the process step by step at Lugo Labs blog.
Devise and Omniauth Upside Down
Devise has an omniauthable module you can mix in the User model to use providers for authentication. My claim is that the proper way of doing it is the opposite, with OmniAuth proposing a Devise strategy as yet another provider. Included : a proof of concept…. :-)
Ruby Primer Slides
I did a two-part Ruby Primer series at work and figured I’d share the slides with anyone interested. It is aimed for beginner & intermediate Rubyists
Try out Bootstrap v4 in Rails
A new version of Bootstrap means upgrading to the newest version. Try out Bootstrap v4 in Rails
Filter Git Commits and group them by Category and File
For reviewing the referenced commits of a story or task, you have to include the issue ID as a hashtag in the commit message, I needed a better overview than just a flat list of commits. [more inside]
When to use freeze and frozen? in Ruby
These days it’s pretty common to see #freeze used in Ruby code. But it’s often not entirely clear WHY freeze is being used. In this post we’ll look at the most common reasons a developer might freeze variables. http://blog.honeybadger.io/when-to-use-freeze-and-frozen-in-ruby/
Opalist Newsletter Has Reached Issue 10
The Opal ecosystem continues to thrive, and projects like react.rb and Volt, opal-irb and Clearwater, are proving that front-end development via Opal has some real perks and some major productivity gains to offer (not to mention just plain Ruby fun!). Opalist keeps you up-to-date on the latest news around the Opal web. Check out Opalist Issue #10 here!