<%= render :partial => 'shared/form_errors', :locals => {:object => @reading} %>

<div class="form-group">
  <%= f.label :label, class: 'control-label' %><br>
  <%= f.text_field :label, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :grade, class: 'control-label' %><br>
  <%= f.text_field :grade, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :color, class: 'control-label' %><br>
  <div id="color_div">
  	<%= f.text_field :color, class: 'form-control' %>
    <!-- We should use the glyph from bootstrap instead of loading a custom img -->
    <input type="image" id="colorpicker_button" src="/assets/colorpicker.png"</input>
  </div>
  
  <script>
	options = {
		trigger_event: "click",
		color: {
		    r: 0,
		    g: 0,
		    b: 0
		},
		onChange: function(colorHSB) {
			//$("#reading_color").val(colorHSB.toHex());
			$("#color_div").children().val(colorHSB.toHex());
		}
	}
	new ColorPicker($("#colorpicker_button"), options);
  </script>

</div>

<%= f.submit 'Save', class: 'btn btn-primary' %>

<%= render :partial => 'shared/form_errors', :locals => {:object => @reading} %>

<div class="form-group">
  <%= f.label :label, class: 'control-label' %><br>
  <%= f.text_field :label, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :grade, class: 'control-label' %><br>
  <%= f.text_field :grade, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :color, class: 'control-label' %><br>
  <div id="color_div">
    <%= f.text_field :color, class: 'form-control' %>
    <!-- We should use the glyph from bootstrap instead of loading a custom img -->
    <input type="image" id="colorpicker_button" src="/assets/colorpicker.png"</input>
  </div>
  <script>
    options = {
      trigger_event: "click",
      color: {
        r: 0,
        g: 0,
        b: 0
      },
      onChange: function(colorHSB) {
        $("#color_div").children().val(colorHSB.toHex());
      }
    }
    new ColorPicker($("#colorpicker_button"), options);
  </script>
</div>

<%= f.submit 'Save', class: 'btn btn-primary' %>

Fix indentation and cleaned code
Fix indentation and cleaned code
