75 lines
2.1 KiB
Ruby
75 lines
2.1 KiB
Ruby
class Crm::DiningQueuesController < BaseCrmController
|
|
before_action :set_dining_queue, only: [:show, :edit, :update, :destroy]
|
|
|
|
# GET /crm/dining_queues
|
|
# GET /crm/dining_queues.json
|
|
def index
|
|
@dining_queues = DiningQueue.all
|
|
end
|
|
|
|
# GET /crm/dining_queues/1
|
|
# GET /crm/dining_queues/1.json
|
|
def show
|
|
end
|
|
|
|
# GET /crm/dining_queues/new
|
|
def new
|
|
@dining_queue = DiningQueue.new
|
|
end
|
|
|
|
# GET /crm/dining_queues/1/edit
|
|
def edit
|
|
end
|
|
|
|
# POST /crm/dining_queues
|
|
# POST /crm/dining_queues.json
|
|
def create
|
|
@dining_queue = DiningQueue.new(dining_queue_params)
|
|
|
|
respond_to do |format|
|
|
if @dining_queue.save
|
|
format.html { redirect_to crm_dining_queues_path, notice: 'Dining queue was successfully created.' }
|
|
format.json { render :show, status: :created, location: @dining_queue }
|
|
else
|
|
format.html { render :new }
|
|
format.json { render json: @dining_queue.errors, status: :unprocessable_entity }
|
|
end
|
|
end
|
|
end
|
|
|
|
# PATCH/PUT /crm/dining_queues/1
|
|
# PATCH/PUT /crm/dining_queues/1.json
|
|
def update
|
|
respond_to do |format|
|
|
if @dining_queue.update(dining_queue_params)
|
|
format.html { redirect_to crm_dining_queues_path, notice: 'Dining queue was successfully updated.' }
|
|
format.json { render :show, status: :ok, location: @dining_queue }
|
|
else
|
|
format.html { render :edit }
|
|
format.json { render json: @dining_queue.errors, status: :unprocessable_entity }
|
|
end
|
|
end
|
|
end
|
|
|
|
# DELETE /crm/dining_queues/1
|
|
# DELETE /crm/dining_queues/1.json
|
|
def destroy
|
|
@dining_queue.destroy
|
|
respond_to do |format|
|
|
format.html { redirect_to crm_dining_queues_path, notice: 'Dining queue was successfully destroyed.' }
|
|
format.json { head :no_content }
|
|
end
|
|
end
|
|
|
|
private
|
|
# Use callbacks to share common setup or constraints between actions.
|
|
def set_dining_queue
|
|
@dining_queue = DiningQueue.find(params[:id])
|
|
end
|
|
|
|
# Never trust parameters from the scary internet, only allow the white list through.
|
|
def dining_queue_params
|
|
params.require(:dining_queue).permit(:name, :contact_no, :queue_no)
|
|
end
|
|
end
|