diff options
| author | jpl | 2016-11-22 16:44:45 +0100 | 
|---|---|---|
| committer | jpl | 2016-11-22 17:59:37 +0100 | 
| commit | 540b2b720791875b8a774cd53d9a49c29c610e37 (patch) | |
| tree | 5d66346eedbc3c5053e950450eb645f98cc770bb /app/controllers/chouette_controller.rb | |
| parent | f12aad6a79ba71d59f30c1ae977babfa8d0d248f (diff) | |
| download | chouette-core-540b2b720791875b8a774cd53d9a49c29c610e37.tar.bz2 | |
Refs #2019: Create table helper for views
Diffstat (limited to 'app/controllers/chouette_controller.rb')
| -rw-r--r-- | app/controllers/chouette_controller.rb | 13 | 
1 files changed, 8 insertions, 5 deletions
| diff --git a/app/controllers/chouette_controller.rb b/app/controllers/chouette_controller.rb index 46691b13e..074fc0515 100644 --- a/app/controllers/chouette_controller.rb +++ b/app/controllers/chouette_controller.rb @@ -2,15 +2,18 @@ class ChouetteController < BreadcrumbController    include ApplicationHelper    include BreadcrumbHelper -   +    before_action :switch_referential -   +    def switch_referential      Apartment::Tenant.switch!(referential.slug) -  end  +  end    def referential -    @referential ||= current_organisation.referentials.find params[:referential_id]   -  end  +    @referential ||= current_organisation.referentials.find params[:referential_id] +  end +  alias_method :current_referential, :referential +  helper_method :current_referential +  end | 
