Spec fixes

This commit is contained in:
2014-12-01 17:54:55 +01:00
parent 9ef3d4b725
commit 60e6b2a648
21 changed files with 74 additions and 86 deletions
@@ -49,10 +49,10 @@ module Suppliers
respond_to do |format|
if @table.save
format.html { redirect_to [:suppliers, @table.section || @table], notice: t('action.create.successfull', model: Table.model_name.human) }
format.json { render json: @table, status: :created, location: @table }
format.json { render json: @table, status: :created }
else
format.html { render action: "new" }
format.json { render json: @table.errors, status: :unprocessable_entity }
format.json { render json: {errors: @table.errors}, status: :unprocessable_entity }
end
end
end
@@ -65,12 +65,10 @@ module Suppliers
respond_to do |format|
if @table.update_attributes(table_params)
format.html { redirect_to [:suppliers, @table.section || @table], notice: t('action.update.successfull', model: Table.model_name.human) }
format.json { head :no_content }
format.js { head :no_content }
format.json { render json: @table }
else
format.html { render action: "edit" }
format.json { render json: @table.errors, status: :unprocessable_entity }
format.js { head :no_content }
format.json { render json: {errors: @table.errors}, status: :unprocessable_entity }
end
end
end