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.
Understanding the rails-jquery CSRF vulnerability (CVE-2015-1840)
Yesterday there was a new vulnerability disclosed in jquery-ruby and jquery-ujs. Learn how you can fix it, and how it works in this blog post
Introducing Lotus Database Migrations
New feature for the upcoming v0.4.0 (Jun 23): database migrations. Fast operations for schema: create, drop, migrate and prepare database. Keep migrations healthy with experimental feature. [more inside]
A guide to the best beginning Rails resources
There are a ton of books, videos, podcasts, and courses for learning Rails. There’s no way you’d have time to go through them all! So what’s the best way for an absolute beginner to learn Ruby and Rails? Which resources should you start with, and when?
Pluralsight: Building Ruby Gems
I created a Pluralsight course on Building Ruby Gems. This course could be helpful to anybody new to Ruby, or to Ruby devs who haven’t built their own gems.
Splat goes Ruby
The spoils and tricks of using * in your code. I’ll bet there’s things you didn’t know.
Avoid race conditions in Rails with Postgres locks
Earlier this year a programmer reported that he discovered a race condition bug in the Starbucks system which allowed him to essentially have an unlimited giftcard balance. It’s obviously a problem that can have some serious financial implications. In this article we explore how to handle race conditions in Rails.
Rails application.rb Recommendations
I just wrote up a short list of things I always want in my config/application.rb that you might also consider helpful.
Subscribing for events in rails_event_store
Subscribe for domain events explicitly, avoid magic, avoid implicit assumptions. All with code samples explaining why and how. [more inside]
Using Lambdas in Ruby
If you’re like me then you never paid much attention to lambdas. As it turns out, they offer some pretty interesting features: http://blog.honeybadger.io/using-lambdas-in-ruby/
Rails Model Translations
Rails gives you a nice way for translating model files with Model.model_name.human and Model.human_attribute_name(attribute). This blog post shows how it works, how form_for is using it and introduces a small gem to generate those files automatically from all of your models.
Error aggregation with RSpec 3.3
Ever wondered, if it is possible to catch all errors from a spec at once? With a new option introduced in RSpec 3.3, you can do this. Check out my blogpost to see how to make this happen!
Recapping RedDotRubyConf 2015
Didn’t get a chance to make it to RedDotRubyConf in Singapore this year? Fear not! This blog post has gotcha covered! It recaps some of the best talks from the conference, and highlights some of the coolest gems you should be using!
Shack: if you like it then you should have put a sha on it.
Shack, a small Rack middleware that makes it easy to retrieve the sha of the currently deployed application. It can also show a small banner with the sha in it. No more figuring out what version is deployed.
Rails open source apps deployed
Open’d is deploying number of open-source Rails apps for free, so everybody can use them. (Errbit, Spree, Redmine etc.)
gem-compare: Releasing a new gem version with confidence
What do you usually do when releasing a new version of gems? Running test suite? Something more? I like to use my tool on tracking changes in RubyGems gem-compare as it gives me a little bit more confidence on what am I actually releasing. Here’s how I do it.
Apache Spark 1.4 in RubySpark
Ruby-spark gem now supports the latest version of Spark.
Securing Environment Variables
Just how safe is it to store secrets in environment variables? How can you make it more safe? http://blog.honeybadger.io/securing-environment-variables/
Game Of Life in Rails
my little implementation of Conway’s Game of Life https://github.com/davidesantangelo/gameoflife in Rails. Live at https://golife.herokuapp.com .
Introducing Lotus Form Helpers
New feature for the upcoming v0.4.0: form helpers. HTML5 form generators with automatic values, CSRF protection, method override, infinite nested fields and ORM agnostic. [more inside]
Following a Select Statement Through Postgres Internals
Pat Shaughnessy shows how Postgres works internally. Learn what a postgres server does when it receives select statements and how it understands SQL. [more inside]
The difference between acceptance, functional and few other testing types
People often talk about different types of tests, but it seems to be a bit hard to keep track of what each type of tests is supposed to do. Here’s a short guide from a Rails developer’s perspective.
QueryBundle (Working Spike)
Batch Active Record queries and save trips to your DB. Working and tested, but the API is currently a work in progress: I’d really appreciate feedback. Also, I’ve run into an issue with converting PG::Results to AR objects. Help would be much appreciated!
Strong Like Bull - A Lesson in Recursion
Introduce Strong Parameters into your application the easy way:
Docker Basics
Running Nginx Webserver in a Container
Closures: Elixir vs. Ruby vs. JavaScript
Here’s my take on closures in JavaScript, Ruby and Elixir