Module: ForemanTemplatesHelper

Defined in:
app/helpers/foreman_templates_helper.rb

Instance Method Summary collapse

Instance Method Details

#edit_pathsObject



2
3
4
5
6
7
8
9
# File 'app/helpers/foreman_templates_helper.rb', line 2

def edit_paths
  Template.subclasses.reduce({}) do |memo, subclass|
    memo.tap do |acc|
      path_part = "#{subclass.name.underscore.pluralize}_path"
      acc[subclass.name] = "#{Rails.application.routes.url_helpers.public_send(path_part)}/:id/edit"
    end
  end
end