Compare commits

...

2 commits

Author SHA1 Message Date
JuliusR 4e18ab61d7 update Gemfile.lock after fe027ff57f 2021-12-18 14:56:27 +01:00
JuliusR ad35e02ddb use Strong Parameters for Supplier 2021-12-18 14:56:09 +01:00
2 changed files with 32 additions and 2 deletions

View file

@ -114,6 +114,7 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
midi-smtp-server (3.0.2)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
minitest (5.15.0)
@ -246,6 +247,7 @@ DEPENDENCIES
haml-rails (~> 2.0)
jbuilder (~> 2.7)
listen (~> 3.3)
midi-smtp-server
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (~> 6.1.4, >= 6.1.4.4)

View file

@ -37,7 +37,7 @@ class SuppliersController < ApplicationController
# POST /suppliers
# POST /suppliers.xml
def create
@supplier = Supplier.new(params[:supplier])
@supplier = Supplier.new(supplier_params)
respond_to do |format|
if @supplier.save
@ -55,7 +55,7 @@ class SuppliersController < ApplicationController
# PUT /suppliers/1.xml
def update
@supplier = Supplier.find(params[:id])
attrs = params[:supplier]
attrs = supplier_params
respond_to do |format|
# @todo fix by generating proper hidden input in html
@ -86,4 +86,32 @@ class SuppliersController < ApplicationController
format.xml { head :ok }
end
end
private
def supplier_params
params
.require(:supplier)
.permit(
:name,
:address,
:phone,
:phone2,
:fax,
:email,
:url,
:delivery_days,
:note,
:ftp_sync,
:ftp_host,
:ftp_user,
:ftp_password,
:ftp_type,
:ftp_regexp,
:mail_sync,
:mail_type,
:mail_from,
:mail_subject
)
end
end