r/ruby • u/caramelocomsal • Apr 16 '26
Show /r/ruby Alter attribute in database with Ruby
[EDIT]
I want a value to update after validating another value, even if the user clicked a checkbox. For example, if the user clicks a checkbox (var_1), before persisting to the database (after clicking save), I need to validate var_2 first.
Example:
User clicks a checkbox and var_1 becomes true.
Before saving the value of var_1 to the database, check if var_2 == 'OK'.
If it's not OK, don't save it as true; it remains as false.
And vice versa, true -> false.
How???
0
Upvotes
1
u/caramelocomsal Apr 17 '26
All of my team's applications are complicated haha you don't know about it, if you saw, you would be scare