
<div class="container">
  <center>
  <h1> Update Reach </h1>
  <div class="update_reach">
    <form action="/reaches/<%= @reach.id %>" method="POST">
      <input type="hidden" name="_method" value="PUT">
      Contact name: <input type="text" name="reach[contact_name]" value="<%=@reach.contact_name %>"><br><br>
      Contact phone: <input type="text" name="reach[contact_phone]" value="<%=@reach.contact_phone %>"><br><br>
      Text: <br>
      <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br>
      Label: <input type="text" name="reach[label]" value="<%=@reach.label %>"><br><br>
      <input type="checkbox" name="reach[main_reach]" <% if @reach.main_reach %>checked<% end %>>Set as primary Reach<br><br>
      <input type="submit" value="Update" class="btn btn-success"><br>
    </form>
  </div>

  <div class="delete_reach">
    <br>
    <br>
    <form action="/reaches/<%= @reach.id %>" method="POST">
      <input type="hidden" name="_method" value="DELETE">
      <input type="submit" value="Delete"  class="btn btn-danger">
    </form>
  </div>
</center>
</div>


<div class="container">
  <center>
  <h1> Update Reach </h1>
  <div class="update_reach">
    <form action="/reaches/<%= @reach.id %>" method="POST">
      <input type="hidden" name="_method" value="PUT">
      Contact name: <input type="text" name="reach[contact_name]" value="<%=@reach.contact_name %>"><br><br>
      Contact phone: <input type="text" name="reach[contact_phone]" value="<%=@reach.contact_phone %>"><br><br>
      Text: <br>
      <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br>
      Label: <input type="text" name="reach[label]" value="<%=@reach.label %>"><br><br>

        <% if @reach.main_reach %>
          <input type="checkbox" name="reach[main_reach]" checked>
        <% else %>
          <input type="checkbox" name="reach[main_reach]">
        <% end %>
      Set as main Reach<br><br>
      <input type="submit" value="Update" class="btn btn-success"><br>
    </form>
  </div>

  <div class="delete_reach">
    <br>
    <br>
    <form action="/reaches/<%= @reach.id %>" method="POST">
      <input type="hidden" name="_method" value="DELETE">
      <input type="submit" value="Delete"  class="btn btn-danger">
    </form>
  </div>
</center>
</div>

Fix check box for main reach
Fix check box for main reach
