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.
A faster way to cache complicated data models
When your data model gets complicated, and your APIs hit that sad 1 second response time, there’s usually an easy fix: :includes. But if you want to cache your responses, you can only fetch one object at a time, and you can’t get all the benefits of :includes. So how do you get a fast response for your cached objects, and still load the objects that aren’t in the cache, quickly?
An excellent Angular Rails tutorial
In my office we are using AngularJs and this seems to be a very good tutorial for Angular Rails http://angular-rails.com
Hoboken: A Sinatra Project Generator
Generate Sinatra projects quickly, yet still maintain the advantage of flexibility that using Sinatra provides. Read more.
Bundle Up & Let Your Objects Do the Freezing: Frozen Hashes
Have you ever tried to modify a frozen object? Or have you always what a frozen object is, exactly? This post explores how frozen objects in Ruby can be dangerous, and why they’re useful.
Open source as a marketing strategy
There’s a misconception that contributing to open source software is a labor of love, and that there’s no money to be made. Well, that’s just wrong because open source software is a low-cost marketing strategy that gives you freedom to monetize in other ways.
The deep basics of Ruby blocks, procs, and lambdas
A full understanding of blocks and procs, and the differences with lambdas is helpful when squeezing the last bit of beloved Ruby expressiveness. Read it!
How much horsepower are you leaving on the table because of bad GC settings?
The MRI 2.2 garbage collector has gaines some significant improvements over its predecessors. There is now much more to tune and optimize for. The default settings are rarely optimal for an app, however, and gaining knowledge of the settings is a pita. [more inside]
Make Capistrano Beautiful with Airbrussh
The airbrussh gem is a replacement log formatter for SSHKit that makes your Capistrano output much easier on the eyes. Just add it to your Capfile and enjoy concise, useful log output that is easy to read. Watch an animated GIF demo.
Video Tutorial: Secure Your Cookies
This tutorial goes over how to better Secure Your Cookies for your Ruby on Rails app.
Extract a service object in any Ruby framework
We often talk about extracting service objects in the Ruby community. Very often it’s in the context of Rails apps. However, the technique is very good in any situation where you deal with a framework (“they call you”). [more inside]
Use your gettext translations in your React components
Expose gettext translations in your Rails app to your frontend with i18next and use them in your React components.
Refactoring: Two Ways -- Design is Refactoring
A post on two approaches you can take when refactoring: the easy way and the hard way.
Introducing Yesql for Ruby using ROM
A fresh new adapter for ROM has been released that allows you to use plain SQL in a similar way as Clojure’s Yesql. You can read about it right here.
ProfileIt.io: profile your Rails app from Chrome
Just launched ProfileIt.io, a lightweight gem+Chrome Extension for profiling Rails apps. ProfileIt.io captures SQL queries, line numbers of slow method calls, and XHR + redirect requests. Production-safe.
API authentication in Rails with devise_token_auth
Just posted a writeup on how to add Token-based API authentication to your Rails app, including some gotchas I found while integrating the devise_token_auth to the menudiar.io site. Any other token auth solutions you know about?
Integrate web templates in Rails application
In this blog I talked about how to integrate web templates from wrapbootstrap into rails application
View components in Rails
I looked at different options for implementing view components in Rails. The article discusses Arbre, Cells and vanilla Rails options such as partials. [more inside]
Splitting Rails router info Separate files
Have you ever struggled with long routes.rb file? Now you don’t have to! [more inside]
Gotcha with after_commit callback in Rails
Make sure that if the code inside transaction is not dependent on result of after_commit callback. http://blog.bigbinary.com/2015/03/01/gotcha-with-after_commit-callback-in-rails.html
Don't Overuse Exceptions
Exceptions are like non-local goto statements, don’t overuse them.
How to get anything done? - 4 tips
Not strictly related to ruby but those four mental tips really help me in my everyday Ruby programmer job to ship projects, write blogposts and books.
Eager Boolean Operators in Ruby: A Pattern to Continue Never Using
Eager Boolean Opeators: A Pattern to Continue Never Using A look at eager Boolean operators and bitwise Boolean operators in Ruby with an in depth analysis of their implementation, merits, and trade-offs.
Version Both Your Github Repo and Gem
Start versioning your github releases to match your gem releases. http://6ftdan.com/allyourdev/2015/03/01/version-both-your-github-repo-and-gem/
Fault Tolerant Router
Do you have multiple internet uplinks? Do you want to use all of the available bandwidth? Do you want to remain online even if some of the uplinks go down? I’ve just released Fault Tolerant Router, check it out!