samedi 16 février 2019

rails checkbox to toggle button when using check_box_tag

I want to turn a checkbox into a toggle button in rails. This is my code:

    <%= form_tag some_path do %>
      <% @vacancies.each do |vacancy| %> 
          <tr>
            <td><%= check_box_tag "vacancies[]", vacancy.id %></td>
          </tr>
      <% end %>
      <%= submit_tag "Purchase" %>
    <% end %>

Is there any simple solution for a toggle when using this check_box_tag?




Aucun commentaire:

Enregistrer un commentaire