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">&times;</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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -