diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/referentials_controller.rb | 10 | ||||
| -rw-r--r-- | app/controllers/stop_area_referentials_controller.rb | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index b03aec7e1..34ba37380 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -11,7 +11,7 @@ class ReferentialsController < BreadcrumbController @referential.data_format = current_organisation.data_format end end - + def show resource.switch show! do |format| @@ -34,18 +34,18 @@ class ReferentialsController < BreadcrumbController def resource @referential ||= current_organisation.referentials.find_by_id(params[:id]) end - + def collection @referentials ||= current_organisation.referentials.order(:name) end - + def build_resource super.tap do |referential| referential.user_id = current_user.id referential.user_name = current_user.name end end - + def create_resource(referential) referential.organisation = current_organisation super @@ -54,6 +54,6 @@ class ReferentialsController < BreadcrumbController private def referential_params params.require(:referential).permit( :id, :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id, :projection_type, :data_format ) - end + end end diff --git a/app/controllers/stop_area_referentials_controller.rb b/app/controllers/stop_area_referentials_controller.rb new file mode 100644 index 000000000..3abd53892 --- /dev/null +++ b/app/controllers/stop_area_referentials_controller.rb @@ -0,0 +1,11 @@ +class StopAreaReferentialsController < BreadcrumbController + + defaults :resource_class => StopAreaReferential + + protected + + def begin_of_chain + current_organisation + end + +end |
