InJutyIndexform
This commit is contained in:
@@ -9,7 +9,8 @@ class Origami::InJutiesController < BaseOrigamiController
|
||||
|
||||
def index_in_juty
|
||||
@juties_in= InJuty.where("dinning_id=?",params[:table_id])
|
||||
@table = params[:table_id]
|
||||
@table = DiningFacility.find(params[:table_id])
|
||||
@in_juty = InJuty.new
|
||||
|
||||
end
|
||||
# GET /in_juties/1
|
||||
@@ -24,9 +25,11 @@ class Origami::InJutiesController < BaseOrigamiController
|
||||
|
||||
# GET /in_juties/1/edit
|
||||
def edit
|
||||
|
||||
end
|
||||
|
||||
def edit_in_juty
|
||||
@in_juty = InJuty.find(params[:id])
|
||||
@table = DiningFacility.find(params[:table_id])
|
||||
end
|
||||
|
||||
@@ -52,11 +55,23 @@ class Origami::InJutiesController < BaseOrigamiController
|
||||
|
||||
def create_for_in_juty
|
||||
@in_juty = InJuty.new
|
||||
@in_juty.dinning_id = params[:dining_id]
|
||||
@in_juty.commissioner_ids = params[:commissioner_ids]
|
||||
@in_juty.in_time = params[:in_time]
|
||||
@in_juty.out_time = params[:out_time]
|
||||
@in_juty.save
|
||||
|
||||
@in_juty.dinning_id = in_juty_params[:dinning_id]
|
||||
@in_juty.commissioner_ids = in_juty_params[:commissioner_ids]
|
||||
@in_juty.in_time = in_juty_params[:in_time]
|
||||
@in_juty.out_time = in_juty_params[:out_time]
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
if @in_juty.save
|
||||
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @in_juty }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @in_juty.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# PATCH/PUT /in_juties/1
|
||||
|
||||
Reference in New Issue
Block a user