menu and section header progress

This commit is contained in:
2014-11-26 20:18:17 +01:00
parent a64d3de319
commit 60f014811c
38 changed files with 450 additions and 96 deletions
@@ -49,7 +49,7 @@ module Suppliers
respond_to do |format|
if @product.save
format.html { redirect_to [:suppliers, :products], notice: t('action.create.successfull', model: Product.model_name.human) }
format.json { render json: @product, status: :created, location: @product }
format.json { render json: @product, status: :created }
else
format.html { render action: "new" }
format.json { render json: @product.errors, status: :unprocessable_entity }
@@ -65,7 +65,7 @@ module Suppliers
respond_to do |format|
if @product.update_attributes(product_params)
format.html { redirect_to [:suppliers, :products], notice: t('action.update.successfull', model: Product.model_name.human) }
format.json { head :no_content }
format.json { render json: @product }
else
format.html { render action: "edit" }
format.json { render json: @product.errors, status: :unprocessable_entity }
@@ -95,7 +95,7 @@ module Suppliers
private
def product_params
params.require(:product).permit(:name, :code, :price, :description, :image, product_category_ids: [])
params.require(:product).permit(:name, :code, :price, :description, :image, :visible, :position, :product_category_id)
end
end
end