From 2377de1ac4b5662095ecb6ea06f574a195593ce7 Mon Sep 17 00:00:00 2001 From: Bohung Date: Mon, 17 May 2021 21:31:39 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/galleries_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index aaa7369..3689b35 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -281,7 +281,11 @@ class Admin::GalleriesController < OrbitAdminController @fiter_albums = albums1.concat(albums2) end def update_album_setting - params_album_setting = params.require(:album_setting).permit! + if params[:album_setting_limit] + params_album_setting = {:limit=>params[:album_setting_limit]} + else + params_album_setting = params.require(:album_setting).permit! + end AlbumSetting.first.update_attributes(params_album_setting) redirect_to '/admin/galleries' end