From 3d5f0f51c10e532b083657f189d629512e8246b6 Mon Sep 17 00:00:00 2001 From: salimhb Date: Thu, 14 May 2020 21:04:15 +0200 Subject: [PATCH] export csv with column order expected for decryption (#16) --- .../concerns/rails_admin_config/for_ticket.rb | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/rails_admin_config/for_ticket.rb b/app/models/concerns/rails_admin_config/for_ticket.rb index 3e8c67d..7959681 100644 --- a/app/models/concerns/rails_admin_config/for_ticket.rb +++ b/app/models/concerns/rails_admin_config/for_ticket.rb @@ -4,7 +4,27 @@ module ForTicket included do rails_admin do - fields :id, :entered_at, :left_at, :area, :encrypted_data + field :id + field :area, :string do + formatted_value do + bindings[:view].link_to( + value&.name, + bindings[:view].show_path(model_name: 'area', id: value&.id) + ) + end + export_value do + value&.name + end + end + field :entered_at + field :left_at + field :encrypted_data + + export do + configure :id do + hide + end + end end end end