Using rename_column, remove_column, etc. more than once in a migration makes that migration run slower than it should...
When you have objects in your database that hold latitude and longitude and you want to find others that are...
Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also...
When using state_machine you sometimes need to know whether an object may execute a certain transition. Let's take...
Clearance is a gem that provides authentication functionality (e.g. login, logout). This note explains, how the clearance login, logout and...
Look here for informations how you can show the MySQL default character set. At first you need the Amazon RDS...
Web fonts are awesome. After being restricted to Arial for two decades there is finally a cross-browser way to...
By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...
To show the collation of your tables you have to login to the MySQL console and execute SHOW TABLE STATUS...
To show the MySQL default character set you have to login to the MySQL console and execute SHOW VARIABLES LIKE...
You can convert git commits into patch files. Those can be used to apply to a different repository [1] or...
The solution in this card is based on a stack overflow post by Leventix. If you need to make request...
While 2.0 will include a number of syntax changes, new features and general improvements, mentioned below, it is anticipated to...
First keep in mind that :dependent => :destroy hooks into before_destroy. So when you use other before_destroy callbacks the...
Looks simpler than inaction_mailer: gem install mailcatcher mailcatcher Setup Rails to send mails to 127.0.0.1:1025. Usually you want...
Given the problem you have a new column postion and that column should be updated for all existing rows with...
Generally for nested forms, a blank form is placed below all other existing object forms. If you would like to...
Defining a custom to_json method for your classes can be useful. Do it properly or you will "randomly" get...
Using git rebase can be painful but luckily you can resort to cheating with git reset and committing anew.
When adding a new field to your model's database table, don't set any defaults in the database.
Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...
In order to open a MySQL shell without the need to enter user and password, you can say the following...
The colors in Rails log files are helpful when watching them but, since they are ANSI color codes like ^[[4...
The technique described in this card has an important caveat: The result of GROUP_CONCAT is truncated to the maximum...