Module: VkontakteAuthentication::Helper

Defined in:
lib/vkontakte/helper.rb

Instance Method Summary collapse

Instance Method Details

#init_vkontakteObject



3
4
5
# File 'lib/vkontakte/helper.rb', line 3

def init_vkontakte
  vkontakte_div + vkontakte_init if vk_app_id
end


7
8
9
10
11
12
# File 'lib/vkontakte/helper.rb', line 7

def (name, url = user_session_path, html_options = {})
  authenticity_token = protect_against_forgery? ? form_authenticity_token : ''
  options = "{ url: '#{url}', authenticity_token: '#{authenticity_token}', session_key: '#{request.session_options[:key]}', session_id: '#{request.session_options[:id]}' }"
  html_options.merge!(:onclick => "vkLogin(#{options});") if vk_app_id
  link_to name, "#", html_options
end