Since the default time in the database is in utc, I would like to be able to display it at the right time for users. To do this, I had to take column :created_at and change it to this:
index do ... column :created_at, :sortable => :created_at do |obj| obj.created_at.localtime.strftime("%B %d, %Y %H:%M) end ... end
It seems pretty easy to do it once or twice, but when you need to override each indexing and display method, the process will get a little tax.
Is there a way to override how ActiveAdmin displays time without having to override each event?
I know that I can create a function, or perhaps itβs better to use functions that provide time, but I still have to use it every time I want to display the time. I want to redefine it without worrying that I missed it.
datetime ruby-on-rails activeadmin
Tom prats
source share