here is my _form.html.haml* I have two check boxs **:is_sales_report_visible :is_invoice_visible I need any of the check box must be checked to update the user please help me out how to make it possible Thanks in advance*
= form_for(@employee , html: {class: 'form-horizontal', role: 'form' }) do |f|
- if @employee.errors.any?
#error_explanation
%h2
= pluralize(@employee.errors.count, "error")
prohibited this employee from being saved:
%ul
- @employee.errors.full_messages.each do |message|
%li
= message
.field
= f.label "email", :class => 'control-label'
.controls
= f.text_field "email",input_html: { :class => 'text_field'} , :required => true, :placeholder =>'Please enter a valid email address'
.field
= f.label :"first_name","First Name", :class => 'control-label'
.controls
= f.text_field :"first_name", input_html: { :class => 'text_field' }, :required => true, :maxlength => 15, :placeholder =>'Enter First Name '
.field
= f.label :"last_name","Last Name",:class => 'control-label'
.controls
= f.text_field :"last_name", input_html: { :class => 'text_field' },:required => true, :maxlength => 15, :placeholder =>'Enter Last Name '
.field
= f.label :"password","Password", :class => 'control-label'
.controls
= f.password_field :"password", input_html: { :class => 'password_field' },:required => true, :maxlength => 15, :placeholder =>'Enter Password'
.field
= f.label :"password_confirmation","Password Confirmation", :class => 'control-label'
.controls
= f.password_field :"password_confirmation", input_html: { :class => 'password_field' },:required => true, :maxlength => 15, :placeholder =>'Enter Password Confimation'
.field
= f.label :role,"Role", :class => 'control-label'
.controls
= f.collection_select(:role_id, Role.all, :id, :role_name, prompt: "Select1")
.field
= f.label :is_sales_report_visible," Visible Factory Sales", :class => 'control-label'
.controls
= f.check_box :is_sales_report_visible, {}, true, false
.field
= f.label :is_invoice_visible," Visible Invoice Details", :class => 'control-label'
.controls
= f.check_box :is_invoice_visible{}, true, false
.form-actions1
= f.submit :class => 'btn btn-primary btn-md'
= link_to "Cancel", employees_path(), :class => 'btn btn-danger', data: { confirm: 'Are you sure you want to cancel' }
Aucun commentaire:
Enregistrer un commentaire