app/views/content/display/_favorite_control.html.erb
<%
if content.favorite?
icon = 'star'
action = 'Unfavorite'
else
icon = 'star_border'
action = 'Favorite'
end
%>
<% if content.persisted? && user_signed_in? && content.user_id == current_user.try(:id) %>
<i class="material-icons right yellow-text favorite-button tooltipped"
data-tooltip="<%= action %> this page"
data-content-id="<%= content.id %>"
data-content-class="<%= content.class.name.downcase.pluralize %>">
<%= icon %>
</i>
<% end %>