Module: MyTimeline::ApplicationHelper

Defined in:
app/helpers/my_timeline/application_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



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

def method_missing(meth, *args, &block)
  if meth.to_s =~ /_path$|_url$/
    if main_app.respond_to? meth
      main_app.send meth, *args
    else
      super
    end
  else
    super
  end
end

Instance Method Details

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


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

def respond_to?(meth)
  if meth.to_s =~ /_path$|_url$/
    if main_app.respond_to? meth
      true
    else
      super
    end
  else
    super
  end
end