DateFields and ActiveRecords


#1

Here is some typical code, right?

<% for column in User.visible_columns true %>

<%= column.human_name %> <%=h @user.send(column.name) %> <% end %>

I want to customize how the date is formatted for timestamps. How do I
do that? (I want the code above to automatically use my new format for
timestamp/datetime columns)


#2

<% for column in User.visible_columns true %>

<%= column.human_name %> <%=h @user.send(column.name) %> <% end %>

I want to customize how the date is formatted for timestamps. How do I
do that? (I want the code above to automatically use my new format for
timestamp/datetime columns)

Try modifing the DATE_FORMATS[:db] constant with your own format…

you can see at:
http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Conversions.html