我試圖通過創建一個標籤:創建通過命令行中的Rails記錄 - 不知道這個錯誤
[14] pry(main)> Tag.create! {"phrase" => "here is my phrase" }
SyntaxError: unexpected tASSOC, expecting '}'
Tag.create! {"phrase" => "here is my phrase" }
^
[14] pry(main)> d = {"phrase" => "here is my phrase"}
=> {"phrase"=>"here is my phrase"}
[15] pry(main)> Tag.create! d ^
我不知道什麼是錯的,但我不能得到這個工作做。任何想法我做錯了什麼?
THX
是的,看起來reasonab也可以,但我認爲它需要作爲一個arg而不是散列。我真的很驚訝。 – timpone