Module: MagicLinks::UrlHelper

Defined in:
app/helpers/magic_links/url_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'app/helpers/magic_links/url_helper.rb', line 4

def magic_link_for(user, template_name, path, expiry = nil)
  template = MagicLinks::Templates.find(template_name)
  raise ArgumentError, 'Template not found' unless template.present?

  template.magic_link_for(user, path, expiry)
end

.magic_url_for(user, template_name, path, expiry = nil) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
16
# File 'app/helpers/magic_links/url_helper.rb', line 11

def magic_url_for(user, template_name, path, expiry = nil)
  template = MagicLinks::Templates.find(template_name)
  raise ArgumentError, 'Template not found' unless template.present?

  template.magic_url_for(user, path, expiry)
end

Instance Method Details



19
20
21
# File 'app/helpers/magic_links/url_helper.rb', line 19

def magic_link_for(user, template_name, path, expiry = nil)
  MagicLinks::UrlHelper.magic_link_for(user, template_name, path, expiry)
end

#magic_url_for(user, template_name, path, expiry = nil) ⇒ Object



23
24
25
# File 'app/helpers/magic_links/url_helper.rb', line 23

def magic_url_for(user, template_name, path, expiry = nil)
  MagicLinks::UrlHelper.magic_url_for(user, template_name, path, expiry)
end