geheimnisvolle ruby syntax-Fehler

ich bin über verwirrt: das ist fast ein copy/paste aus einem RoR-action-mailer-guide, und doch wirft es einen syntax-Fehler:

class Contact < ActionMailer::Base


  def contact a_name, a_company, a_phone, a_email, a_comments
    subject    "Contact request from #{name}"
    recipients "[email protected]"
    from       "[email protected]"
    sent_on    Time.now
    body       { :name => a_name, :company => a_company, :phone => a_phone, :email => a_email, :comments => a_comments }
  end

end

der Fehler ist:

app/models/contact.rb:9: syntax error, unexpected tASSOC, expecting '}' body { :name => a_name, :company => a_company... ^ app/models/contact.rb:9: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' ...{ :name => a_name, :company => a_company, :phone => a_phone,... ^ app/models/contact.rb:9: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' ...ompany => a_company, :phone => a_phone, :email => a_email, :... ^ app/models/contact.rb:9: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' ..., :phone => a_phone, :email => a_email, :comments => a_comme... ^ app/models/contact.rb:9: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' ...email => a_email, :comments => a_comments, } ^

irgendwelche Ideen? ich kann nicht herausfinden, was ich falsch mache hier.

InformationsquelleAutor der Frage kolosy | 2010-12-27

Schreibe einen Kommentar