Reputation: 1038
Hi I'm creatign a site using Rails and bootstrap and I have a problem I can't seem to work out. I have a modal view I want to show when the user clicks a link in the navbar, following the bootstrap documentation I've gotten it to work using a button, but I can't seem to with a link.
It works with:
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">
New Update
</button>
and I've tried
<%= link_to 'New Update', '#', { 'data-toggle' => 'myModal', 'data-target' => '#myModal'} %>
but it doesn' seem to work.
Thanks
Upvotes: 0
Views: 2642
Reputation: 557
Test this:
<%= link_to 'New Update', '#myModal', 'data-toggle' => 'modal' %>
Upvotes: 1