ex_admin icon indicating copy to clipboard operation
ex_admin copied to clipboard

Virtual Field in ExAdmin

Open cdesch opened this issue 8 years ago • 0 comments

If I have a virtual property of User that is calculated based on other tables, such as points for the user, how would you represent that in the index and show pages?


register_resource MyRewards.User do
    filter except: [:encrypted_password]
    index do
        selectable_column()

        column :id
        column :first_name
        column :last_name
        column :mobile
        column :email
        column :card
        column :points
        column :status, toggle: true


        actions()     # display the default actions column
    end

Should it be a modifier on the column :points area or is there something similar to create_changeset :changeset_create that is called during the index and show that can be overridden to perform a query that brings the user with the calculated field?

cdesch avatar Oct 12 '17 21:10 cdesch