html - how to use a modal with link_to in ruby on rails -
i trying link_to
button action
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newtag"> <i class="fa fa-plus"></i> new tag </button>
i want pass path:
code:
<%= render "shared/empty_view", path: contacts_path, title: "you not have tags!", action:"create tag", image: "/no_products.png" %>
i have tried following similar answers similar questions, cant seem right syntax.
<%= link_to "#newtag", data: { toggle: "modal" } %> <i class="fa fa-plus"></i> new tag <% end %> <div id="newtag" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">modal header</h4> </div> <div class="modal-body"> <p>some text in modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> </div> </div> </div> </div>
Comments
Post a Comment