Compare commits
2 commits
e26ef59ea2
...
4e18ab61d7
Author | SHA1 | Date | |
---|---|---|---|
|
4e18ab61d7 | ||
|
ad35e02ddb |
2 changed files with 32 additions and 2 deletions
|
@ -114,6 +114,7 @@ GEM
|
||||||
marcel (1.0.2)
|
marcel (1.0.2)
|
||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
|
midi-smtp-server (3.0.2)
|
||||||
mini_mime (1.1.2)
|
mini_mime (1.1.2)
|
||||||
mini_portile2 (2.6.1)
|
mini_portile2 (2.6.1)
|
||||||
minitest (5.15.0)
|
minitest (5.15.0)
|
||||||
|
@ -246,6 +247,7 @@ DEPENDENCIES
|
||||||
haml-rails (~> 2.0)
|
haml-rails (~> 2.0)
|
||||||
jbuilder (~> 2.7)
|
jbuilder (~> 2.7)
|
||||||
listen (~> 3.3)
|
listen (~> 3.3)
|
||||||
|
midi-smtp-server
|
||||||
puma (~> 5.0)
|
puma (~> 5.0)
|
||||||
rack-mini-profiler (~> 2.0)
|
rack-mini-profiler (~> 2.0)
|
||||||
rails (~> 6.1.4, >= 6.1.4.4)
|
rails (~> 6.1.4, >= 6.1.4.4)
|
||||||
|
|
|
@ -37,7 +37,7 @@ class SuppliersController < ApplicationController
|
||||||
# POST /suppliers
|
# POST /suppliers
|
||||||
# POST /suppliers.xml
|
# POST /suppliers.xml
|
||||||
def create
|
def create
|
||||||
@supplier = Supplier.new(params[:supplier])
|
@supplier = Supplier.new(supplier_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @supplier.save
|
if @supplier.save
|
||||||
|
@ -55,7 +55,7 @@ class SuppliersController < ApplicationController
|
||||||
# PUT /suppliers/1.xml
|
# PUT /suppliers/1.xml
|
||||||
def update
|
def update
|
||||||
@supplier = Supplier.find(params[:id])
|
@supplier = Supplier.find(params[:id])
|
||||||
attrs = params[:supplier]
|
attrs = supplier_params
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# @todo fix by generating proper hidden input in html
|
# @todo fix by generating proper hidden input in html
|
||||||
|
@ -86,4 +86,32 @@ class SuppliersController < ApplicationController
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue