【发布时间】:2012-10-01 00:23:55
【问题描述】:
可能重复:
What's the difference between colon “:” and fat arrow “=>”
我最近遇到了这样一行:
<%= link_to "sample app", '#', id: "logo" %>
我知道哈希和看起来像 {:id => "logo"} 的不可变键,但 id: 是什么?如果这是一个哈希,为什么它不遵循正常的约定?
【问题讨论】:
标签: ruby