jeudi 13 décembre 2018

edit action on popup bootrap modal in rails?

i am beginner .i want to edit action on bootstrap popup modal but view is working edit action is not working

my view

  <%@leaves.each do |leave| %>
 <td><a href="#" data-toggle="modal" data-target="#myModal-<%= leave.id %>"></td>        
   <div class="modal fade" id="myModal-<%= leave.id %>" role="dialog">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header"> 
 </h4>
        </div>
        <div class="modal-body">
            <%= form_for(@leave, url: leave_path)  do |f| %>  
            <%=f.text_field :rejected_reason%>
             <%=f.submit'update'%>
                <% end -%>
        </div>
        <div class="modal-footer ">        
            <%=link_to 'Reject',reject_leave_path(:id=>leave.id), method: :patch,class: "btn btn-danger btn-sm "%>       
        </div>
                           </td>
                           </tr>
                           <% end %>  

my routes

 Rails.application.routes.draw do
    resources :leave      
    end

Aucun commentaire:

Enregistrer un commentaire