Spec fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user