I have this in my helper:
def favorites_count(node)
content_tag :span, class: "card-favorite-count" do
content_tag :i, class: "icon-heart"
node.cached_votes_total
end
end
That is being called like this in the view:
<%= favorites_count(node) %>
And that renders this:
<span class="card-favorite-count"></span>
How do I get it to render the entire thing?
Edit 1
Per @tolgap's suggestion below, I tried this:
def favorites_count(node)
content_tag :span, class: "card-favorite-count" do
content_tag(:i, "" ,class: "icon-heart") + node.cached_votes_total
end
end
But that doesn't output the number value in node.cached_votes_total
. It outputs everything else though, and in the correct semantic order. It is just the final part of this doesn't work quite yet.