Sha256: 98c2b6a6b715a438c5870ceb896482a0bd8db37503533336cfe0856bd59f4743

Contents?: true

Size: 747 Bytes

Versions: 6

Compression:

Stored size: 747 Bytes

Contents

module ActivitiesHelper
  
  # Link to 'like' or 'unlike' depending on the like status of the activity to current_subject
  # 
  # @param [Object]
  # @return [String]
  def link_like(object)
    if !user_signed_in?
      link_to image_tag("btn/nolike.png", :class => "menu_icon")+ 
                t('activity.like'),new_user_session_path
    else
      if (object.liked_by?(current_subject))
        link_to image_tag("btn/like.png", :class => "menu_icon")+ 
                t('activity.unlike'), [object, :like], :method => :delete, :remote => true
      else
        link_to image_tag("btn/nolike.png", :class => "menu_icon")+ 
                t('activity.like'), [object, :like], :method => :post, :remote => true
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
social_stream-base-0.5.2 app/helpers/activities_helper.rb
social_stream-base-0.5.1 app/helpers/activities_helper.rb
social_stream-base-0.5.0 app/helpers/activities_helper.rb
social_stream-0.4.6 app/helpers/activities_helper.rb
social_stream-0.4.5 app/helpers/activities_helper.rb
social_stream-0.4.4 app/helpers/activities_helper.rb