aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZakaria BOUZIANE2015-04-15 13:50:36 +0200
committerZakaria BOUZIANE2015-04-15 13:50:36 +0200
commit16bad9981f6804afd3345e0cb3dbab258142f93c (patch)
tree9761568a797553ad703302654e746f2342289ca8
parentc84c37af67f0188d6c08b8bc7399f8f570145bb0 (diff)
downloadchouette-core-16bad9981f6804afd3345e0cb3dbab258142f93c.tar.bz2
Fix unregistred referential params #0034927
-rw-r--r--app/controllers/referentials_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index a0ca4b4ea..375ce126a 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -28,6 +28,9 @@ class ReferentialsController < BreadcrumbController
end
protected
+
+ alias_method :referential, :resource
+
def resource
@referential ||= current_organisation.referentials.find_by_id(params[:id])
end
@@ -48,8 +51,9 @@ class ReferentialsController < BreadcrumbController
super
end
- def permitted_params
- params.permit(referential: [ :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id ])
+ 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