The benefit of the Rails asset pipeline is that it compiles your stylesheets and javascripts to a single file, respectively...

makandra dev

The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...

When putting phone numbers into web pages, you should use tel: links so smartphone users can click those numbers to...

makandra dev
github.com

Shortener is a Rails Engine Gem that makes it easy to create and interpret shortened URLs on your own domain...

Rails migrations allow you to use a change method whose calls are automatically inverted for the down path. However, if...

Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes...

For our production servers we use Passenger as a Ruby application server. While it is possible to use Passenger for...

github.com

Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.

Firefox 5.0.1, which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here...

The asset pipeline changes the paths of CSS files during precompilation. This opens a world of pain when CSS files...

github.com

bower-rails is a great solution for managing vendored assets in your Rails app. It feels especially much more convenient...

Returning an empty scope can come in handy, e.g. as a default object. In Rails 4 you can achieve this...

We upgraded a Rails 2 application to Rails 3.2 and Ruby 2.1, changed the mysql adapter from mysql to mysql2...

This is what worked for me in a Rails 4: # JSON data as first argument, then parameters patch :update, { some...

Modern browsers natively suppport file pickers that allow the user to choose multiple files at once. To activate this feature...

class Document < ActiveRecord::Base scope :any_tags, -> (tags){ where('tags && ARRAY[?]', tags) } scope :all_tags, -> (tags){ where('tags @> ARRAY...

makandra dev
github.com

A different take on what we're doing with ActiveType. Since it lives under the rails organization it might be...

api.rubyonrails.org

To avoid n+1 queries, you want to eager-load associated records if you know you need to access them...

Cookies without an expiration timestamp are called "session cookies". [1] They should only be kept until the end of the...

So you want to organize your I18n using multiple .yml files but your Rails 4.1 application simply won't use...

There are different ways to run rake: On Rails 4.1+ projects, you have Spring and its binstubs which dramatically improve...

In Rails, you can very easily send emails with HTML and plaintext bodies. However, if you're trying to debug...

# config/initializers/sidekiq.rb # Perform Sidekiq jobs immediately in development, # so you don't have to run a separate process.

Let's say you have two screens: Show a given project Show a report for all projects Ideally you want...