Closed drewbaumann closed 3 years ago
@drewbaumann, virtual attributes are supported in MotorAdmin. All you need to do is to just to add a new column so the column name matches the name of your virtual attribute (basically the AR model instance method).
You can check how it works in the demo app - so here we have a lifetime_value
method (aka virtual attribute):
https://github.com/omohokcoj/motor-admin/blob/master/spec/dummy/app/models/customer.rb#L27
And on the resource settings there is a 'Lifetime value' column added to the resource settings:
Also it's possible to add a virtual column (field) to the create/update resource forms by specifying 'Read-Write' or 'Write-Only' visibility.
@omohokcoj thank you. I must have totally glossed over that while reading the README. Thank you for your support! I've asked a couple questions now and you've been very helpful.
Hello. We are using Lockbox to encrypt sensitive information. These fields are accessible in plaintext via virtual attributes. I'm sure that at some point we will be asked to expose those fields to admins using Motor Admin. Is this possible now or is it a planned feature?
Thank you!