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.
我想从 rails time_select 帮助器的输出中删除“:”。构建分钟选择框时,助手似乎会自动输出此内容。
有任何想法吗?
谢谢!
这些助手的输出通常只是字符串,所以你应该能够说:
<%= time_select("post", "sunrise").gsub(/:/, ' ') %>
[编辑]原来更清洁的解决方案就是说:
<%= time_select("post", "sunrise", :time_separator => "" %>