Sha256: 263749f2028baf47cdac2d41e26393fffccaa5260449c89f9e4095a83ca1b415

Contents?: true

Size: 473 Bytes

Versions: 4

Compression:

Stored size: 473 Bytes

Contents

module Gamification
  module RewardsHelper

    # Present unseen rewards for the given user.
    #
    # options - A Hash of options:
    #           for: A rewardable model.
    #
    # Returns HTML.
    def present_rewards options
      rewardable = options[:for]
      rewards      = rewardable.rewards.unseen
      presentation = render partial: 'gamification/rewards/presentation', locals: { rewards: rewards }

      rewards.see

      presentation
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gamification-1.0.3 app/helpers/gamification/rewards_helper.rb
gamification-1.0.2 app/helpers/gamification/rewards_helper.rb
gamification-1.0.1 app/helpers/gamification/rewards_helper.rb
gamification-1.0.0 app/helpers/gamification/rewards_helper.rb