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 => "" %>