CDRH / sparc

Salmon Pueblo Archaeological Research Collection (SPARC) Rails Site
https://salmonpueblo.org/
0 stars 0 forks source link

Handle table columns within models #136

Closed techgique closed 6 years ago

techgique commented 7 years ago

Would like to handle tables’ column list population and customization within models.

Would prefer we not have to explicitly define a list or method within each table's model, but only if we want to customize the lists we are currently generating.

If we want a method we can call on each model class, we may want to look into extending the base class from which our models are created so we don't have to add a class method to each model. Again, just thinking of how to avoid writing code in every single model.

The addition of feature_no to the Strata table's form is an example of a customization, but it hasn't been added to the results page as well yet.

We're currently only generating form fields from belongs_to relationships. May want to check if we want any other relationships as well. has_many, has_one, has_and_belongs_to_many, through are the other types one may pass to reflect_on_all_associations.

This will also likely be linked to how we unify code in #134

karindalziel commented 6 years ago

Discuss if this has to be v1

techgique commented 6 years ago

If one views /query/artifacts/lithics in Firefox and clicks back and forth between Lithic Inventories and Lithic Debitages you may see the background render as beige until the select with ~20,000 options finishes loading and then it turns to white as desired. Clicking that select also slows the browser to a crawl temporarily. Probably want to remove fs_no selects on query pages.

techgique commented 6 years ago

Implemented in #282