I am having query
@users = User.all
@users contains name, created_at, email, mobile etc as attribute values
I want to update the created at to user readable format from mysql datetime format and update it in controller
I have written the code to convert date to human readable format but don’t know how to set value to the attribute before it goes to view
So any method will be appriciated
Use
strftime()directly on thecreated_atattribute in the view:Docs: http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime