Reputation: 6259
I try to create a popover with rails and bootstrap like this:
<%= content_tag(:a, role: "button", data: {
content: "#{image_tag('/user.png')}",
toggle: "popover",
content: "Click here"
}) %>
But somehow when I render the page is displayed like this (its not encounterd as html):
{:data=>{:content=>"Click here", :toggle=>"popover"}}
In the inspect mode the html looks like this:
<a>{:data=>{:content=>"Click here", :toggle=>"popover"}}</a>
What do I wrong? Thanks!
Upvotes: 1
Views: 506
Reputation: 8744
You forgot to add a value for your tag (second argument):
<%= content_tag(:a, 'your button', role: "button", data: { content: "#{image_tag('/user.png')}", toggle: "popover", content: "Click here" }) %>
Upvotes: 1