I’m using rails3,devise and acts_as_votable
I prepared the view to show ‘bookmark’ or ‘un-bookmark’ depending on his voting situation.
But I have no idea what to put. Anyone has idea?
<% if xxxxxxxxxxxx %> <= *when @community hasn't been voted by current_user*
<%= link_to t('.bookmark', :default => t("helpers.links.bookmark")),
bookmark_community_path(@community), :class => 'btn' %>
<% else %>
<%= link_to t('.unbookmark', :default => t("helpers.links.unbookmark")),
bookmark_community_path(@community), :class => 'btn-danger' %>
<% end %>
You can try
upd: Example from documentation https://github.com/ryanto/acts_as_votable#the-voter