whitelist table and section params on json call
This commit is contained in:
@@ -96,7 +96,13 @@ module Suppliers
|
||||
private
|
||||
|
||||
def table_params
|
||||
params.require(:table).permit(:number, :section_id, :position_x, :position_y)
|
||||
permitted_attributes = [:number, :section_id, :position_x, :position_y]
|
||||
# do not raise in development and test for json communication
|
||||
if request.format.json?
|
||||
params.require(:table).slice(*permitted_attributes).permit!
|
||||
else
|
||||
params.require(:table).permit permitted_attributes
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user