Help with this syntaxis

Well at a basic level the first defines a method called project_attributes= (so that you can do some_object.project_attributes = something) and the other defines an add_to_cart method with an optional argument that defaults to nil). Not much more that can be said without some context.

Fred

The code above has an error, but I can not edit it. Job has_many:projects. Not consider receta, it's 'job'.

Second:   So msg = nil unless I pass a parameter msg with some value. It is correct?

yes, that's what optional arguments do.

Fred