Module: DeviseAuthy::Views::Helpers

Defined in:
lib/devise-authy/controllers/view_helpers.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
11
12
13
# File 'lib/devise-authy/controllers/view_helpers.rb', line 5

def authy_request_sms_link
  link_to(
    I18n.t('request_sms', {:scope => 'devise'}),
    url_for([resource_name, :request_sms]),
    :id => "authy-request-sms-link",
    :method => :post,
    :remote => true
  )
end

#enable_authy_form(&block) ⇒ Object



22
23
24
25
26
# File 'lib/devise-authy/controllers/view_helpers.rb', line 22

def enable_authy_form(&block)
  form_tag([resource_name, :enable_authy], :class => 'authy-form', :method => :post) do
    capture(&block)
  end
end

#verify_authy_form(&block) ⇒ Object



15
16
17
18
19
20
# File 'lib/devise-authy/controllers/view_helpers.rb', line 15

def verify_authy_form(&block)
  form_tag([resource_name, :verify_authy], :id => 'devise_authy', :class => 'authy-form', :method => :post) do
    buffer = hidden_field_tag(:"#{resource_name}_id", @resource.id)
    buffer << capture(&block)
  end
end

#verify_authy_installation_form(&block) ⇒ Object



28
29
30
31
32
# File 'lib/devise-authy/controllers/view_helpers.rb', line 28

def verify_authy_installation_form(&block)
  form_tag([resource_name, :verify_authy_installation], :class => 'authy-form', :method => :post) do
    capture(&block)
  end
end