Change date format in rails form

0

I know there is a way to edit the location, to move it to the Brazilian format. But I do not know the syntax for changing the format in the form:

  <div class="field">
    <p> Garantia </p>
    <%= f.date_select :guarantee %>
  </div>
    
asked by anonymous 22.07.2015 / 21:32

1 answer

2

Put in your config/application.rb

 Time::DATE_FORMATS[:default] = "%d/%m/%Y %H:%M"
 Date::DATE_FORMATS[:default] = "%d/%m/%Y"

That the formatting of all system dates go to the Brazilian standard.

    
18.09.2015 / 16:42