Open jamesmaniscalco opened 11 years ago
ACTUALLY:
This shouldn't be a setting that's adjustable in Angular. It's doable, but a bit out of the scope (heheh).
Instead, there should be a user settings page. There we can keep things like the weight unit, weight precision, etc.
Two sub-issues:
Angular - gear item being edited should be transformed to the correct unit when it goes into the edit form. Then, on save, it should get transformed into grams for the model (though it will then get passed through the filter in the view) before saving to the server.
Rails - User settings controller. There's probably some Devise thing. Make a standard rails form for updating the custom settings. Maybe this can be angularized later, but it's not critical.
Oh, and precision needs to get added as a dynamic property. After the rails part, keep it fixed at 2 for now.
I think the first bit is done.
Did the second part with Angular anyway - made a second page with a new controller and new template.
Needs error handling!
And remember the unit.
Store in grams in the db. Filter in the template. Store the variable for unit on User. Convert to grams when saving.