Module: ActivitiesHelper

Defined in:
app/helpers/activities_helper.rb

Instance Method Summary collapse

Instance Method Details

Link to ‘like’ or ‘unlike’ depending on the like status of the activity to current_user

Parameters:

Returns:

  • (String)


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