added induties
This commit is contained in:
@@ -18,6 +18,7 @@ class Settings::CommissionersController < ApplicationController
|
||||
def new
|
||||
@commissioner = Commissioner.new
|
||||
@employee = Employee.all.order('name asc')
|
||||
|
||||
end
|
||||
|
||||
# GET /commissioners/1/edit
|
||||
@@ -35,14 +36,21 @@ class Settings::CommissionersController < ApplicationController
|
||||
unless @commissioner.resigned_date.nil?
|
||||
@commissioner.resigned_date = @commissioner.resigned_date.utc.getlocal.strftime('%Y-%b-%d')
|
||||
end
|
||||
respond_to do |format|
|
||||
if @commissioner.save
|
||||
format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully created.'}
|
||||
format.json {render :show, status: :created, location: @commissioner}
|
||||
else
|
||||
format.html {render :new}
|
||||
format.json {render json: @commissioner.errors, status: :unprocessable_entity}
|
||||
# puts params[:from_induty].length
|
||||
if (params[:from_induty] != "true")
|
||||
respond_to do |format|
|
||||
if @commissioner.save
|
||||
format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully created.'}
|
||||
format.json {render :show, status: :created, location: @commissioner}
|
||||
else
|
||||
format.html {render :new}
|
||||
format.json {render json: @commissioner.errors, status: :unprocessable_entity}
|
||||
end
|
||||
end
|
||||
else
|
||||
@commissioner.save
|
||||
flash[:notice] = 'Commissioner was successfully created.'
|
||||
redirect_to induties_assign_in_duties_path(params[:booking_id])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user