Class: ResourceDecorator

Inherits:
ApplicationDecorator
  • Object
show all
Defined in:
app/decorators/resource_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_admin_pathObject



12
13
14
# File 'app/decorators/resource_decorator.rb', line 12

def self.new_admin_path
  helpers.send("new_admin_#{model_name.singular}_path")
end

Instance Method Details

#admin_pathObject



4
5
6
# File 'app/decorators/resource_decorator.rb', line 4

def admin_path
  model.persisted? ? helpers.send("admin_#{model_name.singular}_path", model) : helpers.send("admin_#{model_name.plural}_path")
end

#edit_admin_pathObject



8
9
10
# File 'app/decorators/resource_decorator.rb', line 8

def edit_admin_path
  helpers.send("edit_admin_#{model_name.singular}_path", model)
end