http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
| class GalleryImagesController < ApplicationController | |
| def rotate | |
| @image = GalleryImage.find(params[:id]) | |
| rotation = params[:deg].to_f | |
| rotation ||= 90 # Optional, otherwise, check for nil! | |
| @image.rotate!(rotation) | |
| flash[:notice] = "The image has been rotated" | |
| end |
http://guides.rubyonrails.org/migrations.html
Out of the box, Homebrew does a default installation on Sphinx:
$ brew install sphinx
However, if you're using MySQL, the thinking-sphinx gem won't work because it needs to use MySQL libraries.
If you managed to screw up the first time, uninstall sphinx first:
$ brew remove sphinx
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |