Głupi problem z body w mailerze

Hej,
jak mam tak:

body {:user => user, :url => "http://awsome.url" }

to mam taki błąd:

SyntaxError: /home/slawosz/projekty/rails/project/app/models/user_mailer.rb:11: syntax error, unexpected tASSOC, expecting '}' body {:user => user, :url => "http://awsome.url" } ^ /home/slawosz/projekty/rails/project/app/models/user_mailer.rb:11: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' body {:user => user, :url => "http://awsome.url" }
Ale już tak jest ok:

body_hash = {:user => user, :url => "http://awsome.url" } body body_hash
WTF?

Sławosz

body :user => user, :url => “http://awsome.url” ?

irb(main):001:0> def think(hash) irb(main):002:1> puts hash irb(main):003:1> end => nil irb(main):004:0> think {:a => :head} SyntaxError: compile error (irb):4: syntax error, unexpected tASSOC, expecting '}' think {:a => :head} ^ from (irb):4 irb(main):005:0> think({:a => :head}) ahead => nil irb(main):007:0> think :a => :head, :ruby => :rails rubyrailsahead => nil irb(main):008:0>

Dzięki :slight_smile: