Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove ":" from the ruby on rails time_select helper output?

I want to remove the ":" from the output of the rails time_select helper. The helper seems to output this automatically when the minutes select box is built.

Any ideas?

Thanks!

like image 664
Tony Avatar asked Jan 23 '23 16:01

Tony


1 Answers

The output from those helpers are usually just strings, so you should be able to say:

<%= time_select("post", "sunrise").gsub(/:/, ' ') %>

[Edit] Turns out a cleaner solution is to just say:

<%= time_select("post", "sunrise", :time_separator => "" %>
like image 173
Terry Avatar answered Jan 26 '23 06:01

Terry