marco-polo improves your Rails console prompt

Posted Over 8 years ago by Dominik Schöler.
github.com

MarcoPolo shows your app name and environment in your console prompt so you don't accidentally break production Officially supporting...

List of Helpful RubyMine Shortcuts

Posted Over 8 years ago by Dominik Schöler.

CTRL + SHIFT + ALT + N : Search for any symbol in your application, like CSS classes, Ruby classes, methods, helpers etc...

Jasmine: Testing complex types for equality

Posted Over 8 years ago by Henning Koch.

Jasmine comes with two matchers that test for equality. The first is toBe: expect(first).toBe(second) toBe passes when...

Mocking time in Jasmine specs

Posted Over 8 years ago by Henning Koch.
jasmine.github.io

The easiest way to freeze or travel through time in a Jasmine spec is to use the built-in jasmine.clock...

JavaScript events: target vs currentTarget

Posted Almost 9 years ago by Arne Hartherz.

tl;dr: Use event.currentTarget unless you are absolutely certain that you need event.target. Since it hasn't been written down...

How to fix: iPad does not trigger click event on some elements

Posted Almost 9 years ago by Arne Hartherz.

iPads will not trigger click events for all elements. You can fix that, but you don't want to know...

Parallel Rspec with RTeX

Posted Almost 9 years ago by Emanuel.

Running projects parallel makes some trouble with PDF generation. Use geordi rspec spec to force sequential tests for the whole...

Protip: Clone large projects multiple times

Posted Almost 9 years ago by Arne Hartherz.

Large projects usually have large test suites that can run for a long time. This can be annoying as running...

Material Design Lite

Posted Almost 9 years ago by Tobias Kraze.
getmdl.io

CSS (+ some Javascript) framework, implementing Google's material design for static web pages. Can be used for plain websites without...

A non-weird replacement for grouped_collection_select

Posted Almost 9 years ago by Henning Koch.

Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

Rails 3 ActiveRecord::Persistence#becomes does not copy changed attributes

Posted Almost 9 years ago.

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.

Querying model errors in Rails 4

Posted Almost 9 years ago by Dominik Schöler.
api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

Reverse-proxying web applications with Apache 2.4+

Posted Almost 9 years ago by Henning Koch.

Note: Making a reverse proxy with nginx is much more straightforward. A reverse proxy is a "man in the middle...

sessionStorage: Per-window browser storage

Posted Almost 9 years ago by Arne Hartherz.
caniuse.com

All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and...

Upgrading from Capistrano 2 to 3

Posted Almost 9 years ago by Dominik Schöler.
semaphoreci.com

Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...

Testing setTimeout and setInterval with Jasmine

Posted Almost 9 years ago by Henning Koch.
jasmine.github.io

Jasmine has a jasmine.clock() helper that you can use to travel through time and trigger setTimeout and setInterval callbacks:

Why you see a GET "/__identify__" request in Capybara tests

Posted Almost 9 years ago by Henning Koch.

You might wonder about this request in your test.log: Started GET "/__identify__" for 127.0.0.1 at 2015-04-29 18:00...

PostgreSQL vs MySQL: How to UPDATE using a JOIN

Posted About 9 years ago by Arne Hartherz.

When you want to UPDATE a table with information from an associated table, you can JOIN the associated table into...

PSA: "index: true" in Rails migrations does not work as you'd expect

Posted About 9 years ago by Arne Hartherz.

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...

A solid and unobtrusive plugin for form field placeholders

Posted About 9 years ago by Dominik Schöler.
github.com

jquery-placeholder is a simple jQuery plugin that enables form placeholders in browsers that do not support them natively, i.e...

Ruby bug: Symbolized Strings Break Keyword Arguments in Ruby 2.2

Posted About 9 years ago by Dominik Schöler.
bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...

What Ruby’s ||= (Double Pipe / Or Equals) Really Does

Posted About 9 years ago.
rubyinside.com

It is a common misunderstanding that all [op]=-operators work the same way, but actually they don't. ||= and &&=

Using mime types with send_file

Posted About 9 years ago.
iana.org

When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...

RSpec: Tagging examples and example groups

Posted About 9 years ago by Thomas Klemm.
relishapp.com

In RSpec you can tag examples or example groups with any tags you like simply by saying describe ReportCreator, slow...