Commit 338a73ec authored by kushalpandya's avatar kushalpandya Committed by Jarka Kadlecova

Add support for required input validation

parent 33d82ccb
......@@ -15,14 +15,14 @@
= form.label name, title, class: "control-label"
.col-sm-10
- if type == 'text'
= form.text_field name, class: "form-control", placeholder: placeholder
= form.text_field name, class: "form-control", placeholder: placeholder, required: required
- elsif type == 'textarea'
= form.text_area name, rows: 5, class: "form-control", placeholder: placeholder
= form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required
- elsif type == 'checkbox'
= form.check_box name
- elsif type == 'select'
= form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
- elsif type == 'password'
= form.password_field name, autocomplete: "new-password", class: "form-control"
= form.password_field name, autocomplete: "new-password", class: "form-control", required: value.present? ? nil : :required
- if help
%span.help-block= help
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment