Skip to content

Commit

Permalink
Use strong params on generated settings_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
anitagraham authored and parndt committed May 25, 2015
1 parent 5213243 commit 3e20028
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Refinery
def update
@setting = Refinery::Setting.find(params[:id])

if @setting.update_attributes(params[:setting])
if @setting.update_attributes(setting_params)
flash[:notice] = t('refinery.crudify.updated', :what => @setting.name.gsub("<%= singular_name %>_", "").titleize)

if request.xhr? or from_dialog?
Expand All @@ -25,6 +25,11 @@ module Refinery
end

protected

def setting_params
params.require(:setting).permit(:value)
end

def check_setting
setting = params[:id].gsub("<%= singular_name %>_", "")

Expand Down

0 comments on commit 3e20028

Please sign in to comment.