Rails - using capitalize on a month name from l18n -
i have string in view
<%= l event.start_date, format: :long %>
which outputs
18 aout 2013
i capitalize month name without touching yaml file, , tried several options failed miserably. possible?
if call capitalize takes first character, may use titleize
<%=(l date.today, format: :long) %> => "miƩrcoles, 28 de agosto de 2013" <%=(l date.today, format: :long).titleize %> => "miƩrcoles, 28 de agosto de 2013"
please note words turned capital letter
update$ rails c loading development environment (rails 4.0.0) >> helper.l date.today, format: :long => "september 02, 2013" >> helper.l time.now, format: :long => "september 02, 2013 22:56"
Comments
Post a Comment