diff options
| author | Luc Donnet | 2018-02-20 10:38:45 +0100 |
|---|---|---|
| committer | GitHub | 2018-02-20 10:38:45 +0100 |
| commit | d5ff5c82041a9807dbb8bb9a598b74e99ad538f9 (patch) | |
| tree | 8386fe81d95460b60c77a62385a8f3e8f2df055f /app/helpers | |
| parent | d0163321a875a64b8f1e15a614d18663d013da3c (diff) | |
| parent | 5404087a961c831b10c3d597f3113f05b6b02102 (diff) | |
| download | chouette-core-d5ff5c82041a9807dbb8bb9a598b74e99ad538f9.tar.bz2 | |
Merge pull request #294 from af83/5863-use-shallow-urls-for-referentials
5863 Remove workbench id from the querystring
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/referentials_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/referentials_helper.rb b/app/helpers/referentials_helper.rb index 8251377aa..e464ec8a5 100644 --- a/app/helpers/referentials_helper.rb +++ b/app/helpers/referentials_helper.rb @@ -15,4 +15,14 @@ module ReferentialsHelper service = ReferentialOverview.new referential, self render partial: "referentials/overview", locals: {referential: referential, overview: service} end + + def mutual_workbench workbench + current_user.organisation.workbenches.where(workgroup_id: workbench.workgroup_id).last + end + + def duplicate_workbench_referential_path referential + workbench = mutual_workbench referential.workbench + raise "Missing workbench for referential #{referential.name}" unless workbench.present? + new_workbench_referential_path(workbench, from: referential.id) + end end |
