diff options
| author | Xinhui | 2017-12-15 16:24:10 +0100 | 
|---|---|---|
| committer | Zog | 2017-12-19 13:21:49 +0100 | 
| commit | 49952f6be36a59f167310db6f902a84a165150a0 (patch) | |
| tree | fae30b287516fb1236b8c39a208ab9ec9c080142 | |
| parent | b05efc905c3acc6fcc72cf5135799d692c80593e (diff) | |
| download | chouette-core-49952f6be36a59f167310db6f902a84a165150a0.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  | 
