lundi 21 novembre 2016

Call update method when a checkbox is checked

I am trying to figure out how to call the update method when the user checks on the check box. I want to update the database by deleting the value for the check box that is stored in the database. Here is my code

<% @items.each do |item|%>
    <%if item.email == @user.email%>
        <%= form_for @item do |f| %>
            <%= f.check_box :to_do, url: update,:value => item.id%>
            <%= item.to_do%><br />
        <% end %>
    <%end%>
<%end%>




Aucun commentaire:

Enregistrer un commentaire