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.
Using PostgreSQL and hstore with Rails
Rails 4+ brought new column types for PostgreSQL. In this article you’ll see how to use hstore, with examples on how you can query the column and use a custom serializer so you can have type coercion on its values.
Using events to decouple Rails applications
Just another way to decouple components in a Rails application. [more inside]
Talk Slides - Static is the New Dynamic - Jekyll is the New Ruby Killer App
Hello, The slides from the Vienna.rb talk titled “Static is the New Dynamic - Jekyll, Octopress, GitHub Pages n Friends” (use T to toggle, space or cursor to browse) or read the all-in-page version. Topics covered include: Dynamic Site Generators; Static Site Generators; Why Static?; Static Site Generator - Folder Structure Example; Static Site Generators - The Biggies; Build Your Own Static Site Generator in Ruby in 5 Minutes; Static is the New Dynamic - Jekyll is the New Ruby Killer App; Jekyll Getting Started; Jekyll - Beyond the Basics - Collections, Data; Dynamic Examples - Videos, Comments, n More; Jekyll Goodies - HTML Proofer, Prose.io, GitHub.js, Jekyll Planet Gem, WordPress Jekyll Export Plugin; GitHub Pages; Octopress 3.0 Upcoming Cheers.
Rails 4.2 Tutorial for Beginners
Enjoy the first free episode: Running the Server .
Using the Module Factory Pattern for DRY Load-Order Management
The Module Factory is an emerging pattern in Ruby that can serve a variety of purposes and offers an alternative approach to a range of problems. In this post, we look at using the Module Factory pattern to manage dynamic load-order dependencies in a DRY fashion. Read more…
Dynamic Rails Error Pages
Normally, 404 and 500 error pages are static HTML files that live in the public directory of a Rails application. These are boring, minimally-styled pages that don’t get the same treatment as the rest of the app. This tutorial shows you how to move error pages into your Rails app as dynamic views that benefit from application styles, layouts, and view helpers. Read the tutorial.
ParallelCI by Codeship - Get faster tests by running your builds in parallel
ParallelCI allows you to set up test pipelines to split up your test commands and run your test suite in parallel. This speeds up your development by a factor of up to x10! [more inside]
4 Rules of East-oriented code: rule 1
I gave a presentation at RubyConf about East-oriented code and am expanding on it with a description of the first of 4 of the rules
Why attr_accessor is 3x faster than getters and setters
Ruby has 11 different method types under the hood. This post walks through the code that implements their behavior and points out some of the very different performance characteristics you’ll encounter when writing Ruby.
Web Socket Hook: A bridge between web hooks and web sockets
Web Socket Hook is an open-source Sinatra-based service which bridges web hooks and web sockets. Now you can build apps that respond to web hooks even though your app may not be directly accessible from the internet. Using any standard web socket client you can connect to the WebSocketHook service, register a web hook, and receive messages via the web socket when the hook is called. Even in-browser JS or apps running behind a firewall can receive HTTP POSTs.
Ruby Gem of the Week - gli gem - git-like interfaces for awesome command-line tools
Hello, over at Planet Ruby the Gem of the Week Series continues with #7 - the gli gem - (yet another) command parser built ontop of OptionParser in an easy-to-(re)use package offering it’s very own mini-language (domain-specific language) to let you define your commands (or even commands of commands of commands) in plain old Ruby. Cheers. PS: Have your say! Guest posts more than welcome.
Open sourcing Elite Command
Elite Command is a web-based, turn-based, asynchronous multiplayer tactical strategy game I wrote on Rails between 2010 and 2013. It was a project of love, and now I’m releasing it to open source for anyone who wants to tinker with it, build on it, or even just clone and launch it.
How to use Ruby instead of sed and awk
If learning unix utilities for text processing seems too challenging, there’s always the option of using Ruby instead. Read on to find out how Ruby can be used in place of sed, awk etc.
Sending and receiving emails in Rails apps
Every successful business application has to send transactional emails to customers. I’m writing a comprehensive guide for sending and receiving emails in Rails apps. You’ll be able to use it as a reference the next time you need to send emails with Postmark, SendGrid, Mailgun or Mandrill. Ooh, you want to use Customer.io or Intercom? I’ve got you covered. Request your copy.
Practicing Rails: Learn Rails without getting overwhelmed
If you feel like running away when you stare at your newly-generated Rails app, I wrote a book for you.
Testing Elasticsearch In Your Rails 4 Application
Elasticsearch is a great search tool to integrate in your Rails application. One of the hardest parts I’ve found is finding a good test setup for it. Here is how I did it. I included some gists too to make it easier to play with the code.
From Rails to JavaScript frontends
Over the last 5 years, I’ve made a transition from a Rails developer to a JavaScript developer. It started with pains and emotions but ended with a full control over my frontends. I’ve collected 12 blog posts, which I wrote over that time. Reading them may help you make a similar transition.
The 411 on Rails' Polymorphic Associations
Understand polymorphic relationships; Go from the basics into some pretty advanced situations in working with polymorphic/belongs_to relationships. http://6ftdan.com/allyourdev/2015/02/10/rails-polymorphic-models/
Install Ruby on Rails in Windows —and Postgres, and Mongo, and Redis...
After spilling half a glass of water on my work Macbook Air, I set out to setup Rails on my PC once and for all. Having tried solutions like nitrous.io to varying levels of success, I decided that noting would cut it like the real deal. So I set out to install Rails and the full backend stack on Windows, here’s my story!
Better performance with these basic SQL optimizations
There are a number of articles that talk about optimizing your Rails application but most people forget to do these basic ones. Checkout http://www.rubyonrails365.com/low-hanging-fruits-for-better-sql-performance-in-rails/ to learn more.
Planet Ruby New Monthly Series - The World's Greatest Rubyists
Hello, Over at the Planet Ruby I’ve added a new Ruby Star of the Month series that celebrates a new Rubyist every month. The first stars are - surprise, surprise, surprise: - Ruby Star #2015.2 - Floor Drees - What if you could code all summer long?! - Ruby Star #2015.1 - Ryan Davis - Polishing Ruby Since 2000 As always - new nominations welcome. Happy planet. Cheers.
How to keep Rails questions from killing your productivity
While you write code, questions constantly pop into your head. Questions like: How do I call this method? What options does it take? When you don’t know the answer right away, you get yanked out of your flow, and it takes a half hour to get back to where you left off. So how do you find the answers you need without slowing down?
Using insensitive-case columns in PostgreSQL with citext
When I first migrated to Postgres from MySQL, I had some duplicated records until I realized that Postgres uses sensitive-case text columns by default. In this article I’ll show you how you can avoid this problem by using citext.
Ruby String API use and misuse
Sometimes you’ll see code that misuses the String class API; here’s a utility to find that code programatically.