diff options
| author | Xinhui | 2017-12-15 16:24:10 +0100 |
|---|---|---|
| committer | Xinhui | 2017-12-15 16:24:10 +0100 |
| commit | 6d3e500736946404aa6f5f7aa461c04c8d935e11 (patch) | |
| tree | 64796bc4edbc3d21764effecd83acc0eb8dc4377 | |
| parent | 8f69f3f6a9b8b625759fdcab6361b9d4124ace7d (diff) | |
| download | chouette-core-6d3e500736946404aa6f5f7aa461c04c8d935e11.tar.bz2 | |
Refactoring use destroy_link_content & remove create link
Refs #5300
| -rw-r--r-- | app/decorators/company_decorator.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/decorators/company_decorator.rb b/app/decorators/company_decorator.rb index 96a5175bc..50b82d276 100644 --- a/app/decorators/company_decorator.rb +++ b/app/decorators/company_decorator.rb @@ -18,13 +18,6 @@ class CompanyDecorator < Draper::Decorator def action_links links = [] - if h.policy(Chouette::Company).create? - links << Link.new( - content: h.t('companies.actions.new'), - href: h.new_line_referential_company_path(context[:referential]) - ) - end - if h.policy(object).update? links << Link.new( content: h.t('companies.actions.edit'), @@ -37,7 +30,7 @@ class CompanyDecorator < Draper::Decorator if h.policy(object).destroy? links << Link.new( - content: h.t('companies.actions.destroy'), + content: h.destroy_link_content('companies.actions.destroy'), href: h.line_referential_company_path( context[:referential], object |
