Can anyone tell me what is the difference between build and new command on Rails?
Prior to rails 2.2, you needed build for the has_many/has_and_belongs_to_many part of the relation in order for the new record to automatically have it's foreign keys set. For example:
user.timesheets.build
would set the foreign key. I think for rails 2.2 and onwards, new and build do the same thing for has_many and has_and_belongs_to_many relations.