= content_for :page_javascript do :javascript $(function(){ $("#tenant_setting_contract_type_setting_value").on('change',function(){ if (!$(this).is(':checked')) { $('#tenant_setting_licence_count_setting_value').removeAttr('disabled').focus(); } else { $('#tenant_setting_licence_count_setting_value').attr('disabled','disabled'); $('#tenant_setting_licence_count_setting_value').val(""); } }); }); = simple_form_for(@tenant) do |f| .form-inputs .row .col-sm-6.col-md-3 = f.input :name,readonly: !@tenant.new_record?,required: @tenant.new_record?,input_html: {class: ["ime-disable"]} .row .col-sm-10.col-md-5 = f.input :company_name - if @tenant.new_record? .row .col-sm-10.col-md-5 = f.input :user_email,required: true,input_html: {class: ["ime-disable"]} .row .col-sm-6.col-md-3 = f.input :user_name .row .col-sm-6.col-md-3 = f.input :password,required: true,input_html:{ autocomplete: "off" },label: User.human_attribute_name(:password) = f.input :password_confirmation,required: true,input_html:{maxlength: Devise.password_length.max},label: User.human_attribute_name(:password_confirmation) - if @tenant_setting.present? - @tenant_setting.each_with_index do |tenant_setting,index| = tenant_setting_row(tenant_setting.setting_key,@tenant_settings_infos) do = tenant_setting_form_row(tenant_setting.setting_key) do = simple_fields_for("tenant_setting[]",tenant_setting,index: tenant_setting.setting_key) do |tenant_setting_form| = tenant_setting_form.input :setting_value,tenant_setting.simple_form_options(@tenant_settings_infos) .form-actions.col-sm-12 = f.button :submit