Rake tasks
How can I search for available rake tasks? rake -T | grep gem (where “gem” is the thing you are…
Working with gems
Gems are installed by sources, or a repository which holds several gems. Generally all the gems you will need are…
MySQL Dumping Cheat-Sheet
Make a quick dump of a mysql database: mysql_dump db_name > backup-file.sql You can then read that dump file back…
List of Ruby Operands
operand what it does shift position of bits in Bignum and Fixnum ~ bitwise NOT (high-presendence) & bitwise AND (medium-presendence)…
Tips for Working with Rails
Go to script/console to open ruby in interactive mode. script/console loads your environments (everything in environment.rb and all your plugin…
ImageMagick
Using Mac ports sudo port install ImageMagick If you have an existing ImageMagick installed, you will get this error: Error:…
Paperclip with Passenger
1) be sure to put in your environment file (inside your initializer) config.gem “paperclip” 2) make sure your form_form has…
How do I reload my models if I’m in script/console?
Sometimes you’re in script/console and you make a change to your model files, but since Ruby on reads the models…
Writing to the development log in Rails.
logger.debug WHAT_TO_OUTPUT ***** I think this syntax only works in controllers and outside of a controller you have to use…
Methods ending with an equal sign? (Ruby basics)
A method defined on a model that ends with = is an assignment method, so when ActiveRecord is trying to…