Added alert if number_of_pages could not be set
This commit is contained in:
@@ -83,10 +83,15 @@ class Operator::JobsController < ApplicationController
|
||||
end
|
||||
|
||||
def decrement_page
|
||||
@job.decrement_page(params[:din])
|
||||
if @job.decrement_page(params[:din])
|
||||
flash[:notice] = "Job was successfully updated"
|
||||
else
|
||||
flash[:alert] = "Job could not be updated"
|
||||
end
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to operator_jobs_url, notice: "Job was successfully updated." }
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -106,4 +111,3 @@ class Operator::JobsController < ApplicationController
|
||||
params.require(:job).permit(:operator_id, :costumer_id, :operator_firstname, :operator_lastname, :costumer_firstname, :costumer_lastname)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user