Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- validation1 = lambda {|value|
- weight = value.gsub(',', '.').to_f
- if weight < 30 || weight > 200
- true
- end
- }
- @form_model.text :weight, :label => 'Weight', :class => ['input-small', 'float-left'], :label_class => ['label-block-right'], :initial => user["model"]["weight"], :validation => [[/^[0-9\.\,]+$/, "Only numbers allowed"], [validation1, "The weight has to be 30kg or more, but less than 200kg"]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement