Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Field in ExAdmin #406

Open
cdesch opened this issue Oct 12, 2017 · 0 comments
Open

Virtual Field in ExAdmin #406

cdesch opened this issue Oct 12, 2017 · 0 comments

Comments

@cdesch
Copy link

cdesch commented Oct 12, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant