Module: ActivitiesHelper
- Defined in:
- app/helpers/activities_helper.rb
Instance Method Summary collapse
-
#link_like(activity) ⇒ String
Link to ‘like’ or ‘unlike’ depending on the like status of the activity to current_user.
Instance Method Details
#link_like(activity) ⇒ String
Link to ‘like’ or ‘unlike’ depending on the like status of the activity to current_user
7 8 9 10 11 12 13 |
# File 'app/helpers/activities_helper.rb', line 7 def link_like(activity) if (activity.liked_by?(current_user)) link_to t('activity.unlike'), activity_like_path(activity), :method => :delete, :remote => true else link_to t('activity.like'), activity_like_path(activity), :method => :post, :remote => true end end |