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.
Unleash the Power of Storing JSON in Postgres
You can use Postgres as a JSON document store in your Rails app without leaving the relational world behind. Leigh Halliday explains how: Read more
Understanding the Asset Pipeline Plugin
The asset pipeline is a very powerful feature that Rails offers, to solve a wide range of problems related to web designing. Read more
Top 3 Ruby Links for Busy Developers
Top 3 Links for July 9, 2015
Writing API wrappers
An Application Program Interface (API), is an avenue for one piece of software to speak to another. This could be a remote, web-based, HTTP API. Or, the API might be an internal interface for one portion of a software system to talk to another. Designing an API that is simple and maintainable is crucial if its intended to be used and quickly adopted by colleagues or 3rd party developers. Read more
Nested errors in Ruby with Exception#cause
It’s a common pattern in Ruby to rescue and exception and re-raise another kind of exception. But the original exception isn’t lost! You can use Exception#cause to grab it. In this post we show you how. - http://blog.honeybadger.io/nested-errors-in-ruby-with-exception-cause/
A case for instantiating behaviour
In this post we compare 2 solutions to a minor problem. One where the object gets instantiated with the data it should perform on, and the other with the “behaviour” it should do. Check it out
Rails: Don't index the kitchen sink!
Learn how unnecessary indexes easily sneak into your Rails application, and what you can do about it.
Validates_Type a type validator for Rails
No one is particularly fond of littering their code with trys and is_a?s. To remedy this, I make my models assert confidence that the data in my database is what I expect. I’m not talking about type coercion, type casting or any other munging of types that might happen on a typical read/write from your handy dandy ORM of choice. No no, this is the real deal, the bees knees, the elbows of a gazelle: actual type validation.
Module in Ruby
Ruby has many strengths and is a very malleable language. Ruby can be written functionally or object oriented. I tend to lean toward the latter and find myself using a few different patterns regularly. One powerful tool Ruby provides is the use of Modules. You can learn how to use this tool by extending and including modules
Validates_Subset a subset validator for Rails
Do you suddenly wake up in a cold sweat, wondering if there is finally a way to validate that your data is a proper subset that you desire? I too have experienced this horror, and that is why I made a rails style subset validator.
Ruby and Rails Testing Changes Roundup
Over the past few months, there have been a number of developments that will affect the way you test your Ruby code and Rails applications in the future, but you might not have heard about them unless you were paying close attention. This post collects some of the most interesting and important changes in one place.
JRuby - Just Ruby
What is JRuby? Well it is just Ruby, with some sweet performance and parallelism of course! Read about it, who uses it and other advantages here: JRuby - Just Ruby
Citizenship - simple yet useful validation of Portuguese cards
Citizenship is a simple gem that allows validation of Portuguese documents or common identifiers, such as citizen card numbers, bank account numbers (NIB), fiscal numbers (NIF) and more. As most of these IDs have some kind of checksum, Citizenship calculates and verifies them accordingly. We also provide some convenient methods for validating local phone numbers and email addresses. Read more
How to write Rails middleware
Third part of my series about Rack and Rails. This time, the topic is writing Rails middleware. You can read the article here.
4 Easy Ways to Speed Up Your Rails App
Post on the Skylight Blog by @wycats walking through some low-hanging-fruit for boosting the performance of your Rails App.
Dry Up Your Initializers with #tap
Here’s a pattern I’m fond of I thought I’d share.
Using Enumerable as testing abstraction
Enumerable is a very powerful Ruby module. In some cases it can be used to introduce abstraction, decouple from explicit dependencies and simplifying tests. Read about it in my latest article.
Testing an Event Sourced application
Some time ago I’ve published a sample application showing how to build a simple event sourced application using Rails & Rails Event Store. But there was a big part missing there - the tests. Read more
Creating Single Page Applications with Rails & Ember.js.
A neat slides deck explaining why would a Rails programmer fall in love with SPA.
How to “try again” when exceptions happen in Ruby
Ruby provides a few interesting mechanisms that make it easy to “try again” when exceptions happen - though not all of them are obvious or well-known. In this post we’ll take a look at these mechanisms and how they work. http://blog.honeybadger.io/how-to-try-again-when-exceptions-happen-in-ruby/
Using Javascript Libraries in Opal and Vice Versa (Video)
In Episode 8 you can learn how to import Javascript libraries into the “Ruby World” using Native. You can also export Ruby objects using to_n.
Building a Form Data Service with Rails Part2 (video)
Continuing our “Building a Form Data Service with Rails” video series, I’m going through the process of adding the user registration and login features. Check it out!
Droste (self-replicating images) with Ruby & RMagick
I’ve published a new experiment on “cool” graphics with Ruby & RMagick: drosterize, which does self-replicating recursive images. And also shared some thoughts on implementing it.
Sending Transactional Emails From Rails
It seems transactional emails are an afterthought for developers, but it’s an important part of doing business online. The most successful software business, especially ecommerce, optimize their transactional emails to increase engagement and revenue. If you want to leverage (or help your client leverage) transacational emails as a communication tool that drive business results, I’ve compiled the best content on the topic into an email course for you. In the email course, we’ll cover… ++ What exactly are transactional emails? And why are they important? Read more
Stacks and Linked Lists in Ruby
An article discussing some of the more basic data structures done in Ruby. This article explores a Stack, implementing it with a Linked List.