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 presenters and decorators to clean up your templates in Ruby on Rails (VIDEO)
When developing a web application, templates usually need to implement some logic, especially conditionals. I’m going to show you two patterns which are commonly used in web development with Ruby on Rails: presenters and decorators. They are meant to move template logic to dedicated classes, so templates look cleaner and more object oriented.
Microlibrary for rescue exceptions declaratively
I’ve written a microlibrary for rescue exceptions declaratively in your Ruby classes. Rescata dry up your code from begin... rescue... ensure.... end It provides you a method for rescue methods using other methods, lambdas or blocks. Also, this gives you freedom to build any custom solution to rescue for specific error classes.. Hope you enjoy it!
Top 3 Links for the Busy Developers
Read the Top 3 Links for July 4th, 2015
Using Runners in the Volt Framework
In Episode 7 I cover how to seed your database and automate repetitive tasks using the volt runner command.
Customize your Ruby classes with to_s and inspect
You just did an “extract class” refactor, and now your program’s output is all wrong. How do you fix it? Customize your Ruby classes with to_s and inspect. - RubySteps
Integrating Ruby on Rails, sorcery and Google Calendar API
Dominika Mips from our development team just published a blog post on how she integrated Ruby on Rails, Sorcery and Google Calendar API (and how can you integrate with other Google APIs the same way).
Tutorial: Creating process workflow in Rails application
Here I am going to explain how to use rails_workflow gem to build complex business logic in your Rails application. I wanted to create one big tutorial but then decided to split it to several posts describing one demo application. Continue…
Colt Gem Released
Colt is a micro gem used to subscribe to a given plan using the Stripe API. The plans must already exist in your account. The current version can check Stripe credentials and Stripe API version. [more inside]
Ruby Basics
Do you know how the private keyword affects a class method? Read about it here:Hiding a Class Method
How to change the process name of your Ruby programs as shown by `top` and `ps`
Process names for Ruby programs can be noisy, making it difficult to figure out exactly which process is doing what. In this post I show how you can change them to not only make them more friendly, but also display useful status information.http://blog.honeybadger.io/how-to-change-the-process-name-in-ruby-for-top-and-ps/
Prevent broken builds from slowing your team down
mergeq is a set of scripts that makes it easy to get pre-tested commits/merges working in git with any CI server. Teammates can no longer break the build and prevent others from merging. [more inside]
Allowing similar searches in Postgres
Taking advantage of Postgres can make a huge difference in your Rails app. Here is an article I wrote about allowing for similar searches in Postgres, using the trigram extension. Think of Google when it says “Showing results for computer” when you searched “cmputer”.
awesome-webservers - A collection of Ruby web servers @ Planet Ruby
Hello, I’ve started (yet) another awesome list on Planet Ruby. The new awesome-webservers page collects Ruby web servers. Categories include: multi-threaded web server; simple single-threaded web server; async I/O, multi-plexed web server, and others. Anything missing? Contributions welcome. Cheers.
Migrating user data from MySQL to Postgresql (using Kiba ETL)
Glenn Goodrich from SitePoint shares his experience using Kiba ETL and Ruby to migrate data from MySQL to PostgreSQL. With funny pictures and jokes, too!
Tweet like Larry King
Larry King has a very special way of tweeting. With a bit of Ruby and Twilio magic, you too can tweet like Larry King.
Three little ruby hacks I love
Blog posts don’t have to be about big ideas all the time. Here are 3 little hacks I love to make Ruby even better.
The clever hack that makes `items.map(&:name)` work
Ruby’s “ampersand colon” isn’t an operator. I wrote a quick blog post explaining how it works under the hood: http://blog.honeybadger.io/how-ruby-ampersand-colon-works/
Capybara and asynchronous stuff
An article about running asynchronous JavaScript code in Capybara
Terminal Kung Fu - Knowledge from the Command Line Masters
Take your command line game to the next level with these lesser known commands that are wielded by the masters. http://www.rubyonrails365.com
Building a Ruby Gem in 2015
Building and publishing a gem, even a simple one, is a great way to level up your Ruby skills and gain experience with GitHub’s powerful ecosystem of tools. Here’s what I learned.
Creating easy, readable attributes with ActiveRecord enums
Imagine a question that can be either “pending”, “approved”, or “flagged”. Some models call for this kind of data. An attribute that can have only one of a few different values, values that rarely change. Recently, Rails took a stab at solving this with ActiveRecord enums.
Organizing JavaScript in Rails Applications with Turbolinks
I wrote a new article on Organizing JavaScript in Rails Applications with Turbolinks. Hope you enjoy!
DeepDup Gem Released
I was not able to find a plain Ruby some_deeply_nested_object.deep_dup library so I created one. GitHub link to the gem: deep_dup.
The Node.js task runner diaspora
This is the first episode of our new BazaarJS series, dedicated to exploring the world of JS, from the point of view of a Rails developer… today we’ll be talking about build tools and task runners. Gulp, Grunt, Broccoli: why so many choices, which one is better? [more inside]
Cognac Gem Released
A simple library to implement Amazon S3 upload using CORS. Browse the source code or view it on Rubygems.org