.row .col-sm-12 .box .box-header.dark-background .box-content = form_for [:user, @registration], html: { multipart: true, class: 'form form-horizontal'} do |f| = form_group(@registration, :product_id) do %label.col-md-2.control-label{for: :product_id} Printer* .col-md-5 = f.collection_select :product_id, Product.all, :id, :name, { prompt: true }, class: 'form-control' = form_group(@registration, :serial_number) do #help_sn.icon-question-sign.left{ "data-featherlight" => "image", :href => "../../assets/snhelp.jpg"} %label.col-md-2.control-label{for: :serial_number} Serial Number* .col-md-5 = f.text_field :serial_number, class: 'form-control' #sawgrassable = form_group(@registration, :date_of_purchase) do %label.col-md-2.control-label{for: :date_of_purchase} Date of Printer Purchase .col-md-5.datepicker.input-group = f.text_field :date_of_purchase, class: 'form-control', data: { format: 'yyyy-MM-dd' }, :data => {'provide' => 'datepicker'} %span.input-group-addon %span.icon-calendar{ data: { 'date-icon' => 'icon-calendar', 'time-icon' => 'icon-time'}, id: 'cal_icon' } = form_group(@registration, :proof_of_purchase) do %label.col-md-2.control-label{for: :proof_of_purchase} Proof of Printer Purchase .col-md-5 - unless @registration.has_proof_of_purchase? %small jpg, png, pdf or tiff up to 10MB = f.file_field :proof_of_purchase, class: 'form-control' - else = f.file_field :proof_of_purchase, class: 'form-control' = link_to("Proof of Purchase", @registration.proof_of_purchase.url) .warranty{:id => "warranty"} = form_group(@registration, :reseller_warranty_code) do %label.col-md-2.control-label{for: :reseller_warranty_code} Warranty Code .col-md-5 = f.text_field :reseller_warranty_code, class: 'form-control' .form-actions.form-actions-padding-sm .row .col-md-10.col-md-offset-2 = f.submit "Save", class: 'btn btn-primary' :javascript window.registration = #{@registration.to_json}; :javascript $(document).ready(function(){ $('#product_registration_serial_number').attr('disabled', 'disabled'); $('#product_registration_reseller_warranty_code').attr('disabled', 'disabled'); $('#product_registration_product_id').attr('disabled', 'disabled'); }) function showSnHelp(){ console.log("Help") }