aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/referentials_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/referentials_controller.rb')
-rw-r--r--app/controllers/referentials_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index 9cf4a5f62..643c780a4 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -25,18 +25,25 @@ 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
end
+ def permitted_params
+ params.permit(referential: [ :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id ])
+ end
+
end