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
@@ -73,7 +73,7 @@ module Suppliers
# POST /lists
# POST /lists.json
def create
@list = List.new(params[:list])
@list = List.new(list_params)
@list.supplier = current_supplier
respond_to do |format|
@@ -102,7 +102,7 @@ module Suppliers
@list = List.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
respond_to do |format|
if @list.update_attributes(params[:list])
if @list.update_attributes(list_params)
format.html { redirect_to [:suppliers, @list], notice: t('action.update.successfull', model: List.model_name.human) }
format.json { head :no_content }
format.js { head :no_content }
@@ -126,5 +126,11 @@ module Suppliers
format.json { head :no_content }
end
end
private
def list_params
params.require(:list).permit(:state, :needs_help, :needs_payment, :closed_at, :join_requests, :price, :is_paid, :paid_at, :table_id, :section_id)
end
end
end