One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I...

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

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

In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...

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

Capybara will fail to find tags that are missing an href attribute. This will probably happen to you every now...

Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time...

Safari on iOS accepts an apple-touch-icon favicon that is used for stuff like desktop bookmarks. Always define a...

When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...

Your development machine is usually on a very good network connection. To test how your application behaves on a slow...

By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...

makandra dev

When you call a method on an object, Ruby looks for the implementation of that method. It looks in the...

Tests are about 100% control over UI interaction and your test scenario. Randomness makes writing tests hard. You will also...

What Rails version Within before_* Within after_* Cancel later callbacks Rails 1-4 return false return false Cancel later callbacks...

Say you have a User with a Carrierwave attribute #avatar: class User < ActiveRecord::Base mount_uploader :avatar, AvatarUploader end

Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...

When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...

Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...

1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...

Sometimes you want git to ignore certain files that appear on your machine. You can do this in 3 ways...

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

In the following example the method update_offices_people_count won't be called when office_id changes, because it...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...