updating part2, far from finished
This commit is contained in:
@@ -54,7 +54,7 @@ module Suppliers
|
||||
# POST /sections
|
||||
# POST /sections.json
|
||||
def create
|
||||
@section = Section.new(params[:section])
|
||||
@section = Section.new(section_params)
|
||||
@section.supplier = current_supplier
|
||||
|
||||
respond_to do |format|
|
||||
@@ -74,7 +74,7 @@ module Suppliers
|
||||
@section = Section.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @section.update_attributes(params[:section])
|
||||
if @section.update_attributes(section_params)
|
||||
format.html { redirect_to [:suppliers, @section], notice: t('action.update.successfull', model: Section.model_name.human) }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
@@ -157,5 +157,11 @@ module Suppliers
|
||||
@orders = @list ? @list.active_orders : []
|
||||
render layout: false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def section_params
|
||||
params.require(:section).permit(:title, :path, :width, :height)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user