updating part2, far from finished

This commit is contained in:
2013-12-20 19:22:12 +01:00
parent 748944865d
commit b4c4a15e60
22 changed files with 2779 additions and 62 deletions
@@ -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