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

airpair.com

In the Controller: // Instead of doing this: app.controller('TodoCtrl', function ($scope) { $scope.input = 'ex. buy milk'; }); // Do this: app.controller('TodoCtrl', function...

When you run code inside a $watch expression that forces a repaint (e.g. by computing an element's width, or...

tutorialzine.com

A very clever hack to parse a structured URL object is to create a element and set its href to...

If you get one of this errors: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: ( ): found...

github.com

BubbleTree is a library for interactive visualization of hierarchical data. Originally developed mainly for spending data, the library is now...

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

On your credit card summary, you will find order numbers of rides with Deutsche Bahn ("DB BAHN A-NR XYZ123...

Restangular can make use of $http's built-in response cache. # Cache response for single request Restangular.one('accounts', 123).withHttpConfig...

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

Browsers make this very hard. Even when you explicitely set the selection inside the textarea (e. g. using jquery-fieldselection...

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

api.jquery.com

Simply use one(...) instead of on(...). It takes the same arguments.

Since we are using LoDash instead of UnderscoreJS in recent/current projects, you should keep in mind that their syntax is...

Creating records in specs can be so fast that two records created instantly after one another might have the same...

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...

p ActiveRecord::Base.connection.indexes(:table_name)

This may be hard to find in the docs, but if you want CoffeeScript classes that instantiate their properties from...

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

tl;dr: Use with_index ActiveRecord's find_each with index If you do not provide a block to find...

api.rubyonrails.org

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

Use reorder to replace an existing order clause with a new expression.

If you get an error like this: An error occurred while installing pg (0.17.1), and Bundler cannot continue.