on-site / grantzilla

A grant application management web app
MIT License
10 stars 11 forks source link

Limit Grant Request Value #294

Closed lamplus closed 7 years ago

lamplus commented 7 years ago

Crisis & Grant Request Wizard Step Add guard to limit the Grant Requested amount to be max of $2,500

joedean commented 7 years ago

I tried to add the following code with no success

input_html: {data: {guard: "required moneyUS", "guard-moneyUS-min" => "2500.00"}} %> It generates the following <input data-guard="required moneyUS" data-guard-moneyus-min="2500.00" class="form-control money required" value="1000.00" type="text" name="grant[grant_amount_requested]" id="grant_grant_amount_requested">

The forms helper converts the string to all lower case so the min value is not picked up by gaurds. Therefore will need to manually apply the guard instead of adding the data attribute.

joedean commented 7 years ago

pull request created