Fill multiplier field, confirm Add button disabled

This commit is contained in:
2024-12-12 00:44:26 +01:00
parent 3a25c1dbd0
commit d5719b1e9d
5 changed files with 39 additions and 7 deletions

View File

@@ -132,4 +132,10 @@ module ApplicationHelper
def disabled_attributes(disabled)
disabled ? {disabled: true, aria: {disabled: true}, tabindex: -1} : {}
end
def number_attributes(type)
step = BigDecimal(10).power(-type.scale)
max = BigDecimal(10).power(type.precision - type.scale) - step
{min: -max, max: max, step: step}
end
end