Module: CommunicartMailerHelper

Defined in:
app/helpers/communicart_mailer_helper.rb

Instance Method Summary collapse

Instance Method Details

#approval_action_url(approval, action = 'approve') ⇒ Object


17
18
19
20
21
22
23
24
# File 'app/helpers/communicart_mailer_helper.rb', line 17

def approval_action_url(approval, action = 'approve')
  approval_response_url(
    cart_id: approval.cart_id,
    user_id: approval.user_id,
    cch: approval.api_token.access_token,
    approver_action: action
  )
end

#generate_bookend_class(index, count) ⇒ Object


6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/communicart_mailer_helper.rb', line 6

def generate_bookend_class(index, count)
  case index
  when count - 1
    'class=last'
  when 0
    'class=first'
  else
    ''
  end
end

#status_icon_tag(status) ⇒ Object


2
3
4
# File 'app/helpers/communicart_mailer_helper.rb', line 2

def status_icon_tag(status)
  image_tag("icon-#{status}.png", class: "status-icon #{status}")
end