Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在erb中注入这样的东西:
"This is item number 3"
所以我用:
<%= t(:this_is_item_number) + " " + @item.id %>
有没有更好的方法在注射内增加空间?
谢谢!
en.yml
en: this_is_item_number: This is item number %{number}
* .erb
<%= t(:this_is_item_number, number: 3) %>
结果
这是项目编号 3
你经常看到
"#{t(:this_is_item_number)} #{@item.id}"