Module: Magic::Link::ApplicationHelper

Defined in:
app/helpers/magic/link/application_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/magic/link/application_helper.rb', line 4

def method_missing method, *args, &block
  if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
    if main_app.respond_to?(method)
      main_app.send(method, *args)
    else
      super
    end
  else
    super
  end
end

Instance Method Details

#respond_to?(method, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/magic/link/application_helper.rb', line 16

def respond_to?(method, include_all = false)
  if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
    if main_app.respond_to?(method)
      true
    else
      super
    end
  else
    super
  end
end