When using TextMate2 with the cucumber bundle, it does not recognize step definitions (e.g. custom_steps.rb) as such but believes they...
Splitting a long method into sub methods is easier in instances since it is in classes. Since...
Ruby’s model for concurrency is based on threads. It was typical approach for object oriented languages, designed in the...
Check out the jsFiddle Demo. CSS .absoluteCenterWrapper { position: relative; /* Declare this element as the anchor point for centering */ } /* Positioning */ .absoluteCenter...
By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...
Put the attached file to config/initalizers to ignore some fields for rejecting nested records (e.g. hidden input fields).
Batman is an alternative Javascript MVC with a similar flavor as AngularJS, but a lot less features and geared towards...
When you call a method on an object, Ruby looks for the implementation of that method. It looks in the...
When you use a belongs_to or has_many macro you might be surprised that the methods that it generates...
Store each models version in a separate table class Post < ActiveRecord::Base has_paper_trail :class_name => 'PostVersion' end
Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...
To print a colored full-width bar on the bash, use this bash script expression: echo -e '\033[37;44m...
rake stats # => LOC per controllers, models, helpers; code ratios, and more rake notes # => collects TODO, FIXME and...
String#indent is not a standard Ruby method. When you use it, be sure to know where this method comes...
You might have a table without a primary key set in MySQL. You can fix this by adding a primary...
Wondering how a specific method on an object is exactly named? You can use Enumerable#grep to detect it in...
For reasons that completely escape me, MySQL 5.x limits UTF-8 strings to U+FFFF and smaller.
Tests are about 100% control over UI interaction and your test scenario. Randomness makes writing tests hard. You will also...
I had to deal with JavaScript Undefined Error while accessing a specific CKEditor instance to fill in text. Ensure everything...
Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...
class Book::Page end class MyBook < Book def new_page Page.new # has to be `Book::Page` in development to...
Ask before leaving an unsaved CKEditor Vanilla JavaScript way, but removes any other onbeforeunload handlers: $(function(){ document.body.onbeforeunload = function() { for(editorName...
When you are working with Backbone models and inheritance, at some point you want to overwrite inherited methods but call...
Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is...