mardi 20 octobre 2015

Rails datagrid configuration file

I have bogdan/datagrid gem and I try to change date format through the config file :

But I don't know where to place this

Datagrid.configure do |config|

  # Defines date formats that can be used to parse date.
  config.date_formats = ["%m/%d/%Y", "%Y-%m-%d"]

  # Defines timestamp formats that can be used to parse timestamp.
  config.datetime_formats = ["%m/%d/%Y %h:%M", "%Y-%m-%d %h:%M:%s"]

end

I try to put this in a new file config/datagrid.rb but it's not handled. Does anybody have an idea ?

Aucun commentaire:

Enregistrer un commentaire