mercredi 16 novembre 2016

Reset rails_admin field value

How can I reset the formatted_value on a field in rails admin. So far I tried this without much luck:

  currentId = 0
  # Fields in Projects list
  config.model 'Project' do
    list do
      field :id do
        formatted_value do
          currentId += 1
        end
      end
      field :year
      field :title
      field :intro
      field :description
      field :confidential
      field :star
      field :image
    end
    currentId = 0

Aucun commentaire:

Enregistrer un commentaire