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 when the environment loads, your change isn’t reflected right away in your script/console environment. This will explicitly tell Ruby to reload the environment from scratch. Unfortunately you’ll loose any local variables which were assigned too.

script/console reload!

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 rails_default_debugger ******

(where WHAT_TO_OUTPUT is a string or interpolated to be a string)

The log is in your rails app: log/development.log

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 save an attribute to this model, you can define a custom action to perform the save. Useful, for example, when passing a hash to this model for some list of things that is not part of active record.

With Passenger where does the console log (output from puts) go?

When running Passenger (module for running Rails on Apache), the console log (output from puts) goes into the apache error log (see /var/log/apache2/error_log)