-
Moving back to the last cursor position in line in vim
Ever have a stray keystroke in vim that jumped to somewhere you didn’t intend to go? Two backticks “ will jump to the exact position of where you were. Two single quotes ” will jump to the first non-blank character where you were. This also works for moving to the beginning of a line/cursor position…
-
Moving Static Files to the Assets Pipeline (upgrading from 3.0 to 3.1+)
For those who have done the upgrade, this is probably second nature: Recently stumbled upon static files in the public/javascripts directory and wanted to get them moved to the $RAILS_ROOT/app/assets/ directory. This RailsCast, 282 Upgrading to Rails 3.1 provides most of the notes you need on doing this. The first key is to include: config.assets.enabled…
-
Enums in ActiveRecord 4.1 and options_for_select
Update: This StackOverflow answer provides a better way to use a drop-down with enums. I could’ve sworn I tried that, but maybe not. I discovered something interesting about the way ActiveRecord 4.1 enums work. If you’re trying to use them with options_for_select, you may need to do some little acrobatics with your enums. Assume your…
