I have a rails form that displays a date in a text_field:
<%= form.text_field :check_in_date %>
The date is rendered as yyyy-m
So I did something like this in the model.
def start_date
super.strftime "%Y/%m/%d %H:%M"
end
Say you have a column called start_date in model, and want to display another format in the form, just overwrite its value in model.
And nothing needs to be changed in the form.
<%= f.text_field :start_date, class: 'form-control' %>