Module: FilesystemExplorer::ApplicationHelper

Defined in:
app/helpers/filesystem_explorer/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



13
14
15
16
17
18
19
# File 'app/helpers/filesystem_explorer/application_helper.rb', line 13

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

Instance Method Details

#breakdown_path(path) ⇒ Object



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

def breakdown_path(path)
  paths = [path]

  while path = path.parent
    paths.unshift path
  end

  paths
end