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.
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 Read more
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:
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! Read more
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. Read more
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!
Should you use scopes or class methods?
Scopes are a great way to grab the right objects out of your database. But when you call them, they look almost exactly like calling a class method. And class methods can do most of the same things scopes can. So why would you use a scope when you could use regular Ruby class methods?
Debug Rails Faster with Quiet Assets & Quieter Logs
You may find Rails’ default logging obstructs your debugging efforts when it floods the server output with waves of asset requests. Bypass this extra logging and streamline your debugging workflow by installing the Quiet Assets gem:
How to Write Smoke Tests for an Ember Rails Stack
Micah Woods explains how to run smoke tests when writing an app using the Ember Rails stack.
Locally Sourced: Using Tests to Add a Feature to a Rails Application
Noel Rappin has released a new sort-of book, “Locally Sourced: Adding a Feature to a Rails Application”, which describes the entire process of building features into Rails including integration and unit testing, and also covers the difference between traditional and mock tests. Get the issue at https://www.patreon.com/posts/3254253. Support a Patreon campaign for more content at http://www.patreon.com/noelrap.
Rubinius <3 Gitter
How and why the Rubinius team uses Gitter, and why we love it so.
How to exit a Ruby program
If you want your app to behave well in a unix environment, it’s important that it exit correctly. In this post you’ll learn all about unix exit codes, the mechanism that Ruby uses to exit a program, and how you can add custom behavior on exit. - http://blog.honeybadger.io/how-to-exit-a-ruby-program/
Simple Twitter Bot in Ruby
In just a few lines of Ruby, you can create a simple bot for Twitter actions
Transactional Services Through Background Jobs
Mitigate the lack of transactional safety by leaning on Sidekiq for discrete background jobs when interfacing with external systems.
Inflections Everywhere: Using ActiveSupport Inflector
Grammar is important, especially when it comes to following Rails conventions. But grammar is also hard, and languages have all sorts of exceptions! Rails’ ActiveSupport::Inflector is a great tool when it comes to handling these linguistic roadblocks. This blog post walks through using the Inflector and writing your own custom inflections.
The ModelAttribute gem - an alternative to Virtus
ModelAttribute provides a simple alternative to Virtus for adding attributes to models. Its key advantage over Virtus is built-in dirty tracking, making ModelAttribute perfect for models that are backed by a web service. Read more
Upcoming Ruby Conferences - September 2015 Edition - Live Version Try $ rubyconf
Hello, For you convenience the upcoming Ruby Conferences as listed with the whatson gem and the included rubyconf command line tool (for a live version try $ rubyconf): Read more
(Rails) Application directories named as architectural patterns antipattern
Explaining why grouping class files in directories using an architectural pattern name is unintuitive and giving an alternate solution at: