Module: LoyalCore::Ajax::RatingTracksHelper

Included in:
LoyalCore::ActionHelper
Defined in:
lib/loyal_core/action_helper/ajax/rating_tracks_helper.rb

Instance Method Summary collapse

Instance Method Details



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/loyal_core/action_helper/ajax/rating_tracks_helper.rb', line 19

def loyal_core_helper_ajax_down_rating_link_to target, options={}
  link_to  "javascript:;", {
    'march-on' => 'ajax',
    'march-type' => 'target-type',
    'march-id' => target.uuid,
    'march-action' => 'down'
  }.merge(options) do
    html = ''
    html << (image_tag image_path("loyal_core/down_rating.gif"))
    html << "<span class='count'>#{target.down_rating}</span>"
    raw html
  end
end


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/loyal_core/action_helper/ajax/rating_tracks_helper.rb', line 5

def loyal_core_helper_ajax_up_rating_link_to target, options={}
  link_to  "javascript:;", {
    'march-on' => 'ajax',
    'march-type' => 'target-type',
    'march-id' => target.uuid,
    'march-action' => 'up'
  }.merge(options) do
    html = ''
    html << (image_tag image_path("loyal_core/up_rating.gif"))
    html << "<span class='count'>#{target.up_rating}</span>"
    raw html
  end
end