Ruby on Rails: debugging and nil/NULL values
Debugging from within a view:
< %= debug(@object) %>
And from within a controller:
logger.error(@object.inspect)
Also, to insert NULL values into a MySQL table you need to receive an empty string as the form’s field value, and the matching database field obviously has to allow NULL values. Rails considers an empty string to be nil, which it then translates to NULL for the database.