on-site / grantzilla

A grant application management web app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit Grant Request Value

lamplus opened this issue · comments

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

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.

pull request created