CRUDIn_Juties

This commit is contained in:
yamin
2017-08-23 18:14:31 +06:30
parent 784da2cf09
commit d88199150e
10 changed files with 133 additions and 44 deletions

View File

@@ -28,7 +28,7 @@ class Origami::InJutiesController < BaseOrigamiController
respond_to do |format|
if @in_juty.save
format.html { redirect_to @in_juty, notice: 'In juty was successfully created.' }
format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully created.' }
format.json { render :show, status: :created, location: @in_juty }
else
format.html { render :new }
@@ -42,7 +42,7 @@ class Origami::InJutiesController < BaseOrigamiController
def update
respond_to do |format|
if @in_juty.update(in_juty_params)
format.html { redirect_to @in_juty, notice: 'In juty was successfully updated.' }
format.html { redirect_to origami_in_juty_path(@in_juty), notice: 'In juty was successfully updated.' }
format.json { render :show, status: :ok, location: @in_juty }
else
format.html { render :edit }
@@ -56,7 +56,7 @@ class Origami::InJutiesController < BaseOrigamiController
def destroy
@in_juty.destroy
respond_to do |format|
format.html { redirect_to in_juties_url, notice: 'In juty was successfully destroyed.' }
format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully destroyed.' }
format.json { head :no_content }
end
end
@@ -69,6 +69,6 @@ class Origami::InJutiesController < BaseOrigamiController
# Never trust parameters from the scary internet, only allow the white list through.
def in_juty_params
params.fetch(:in_juty, {})
params.require(:in_juty).permit(:dinning_id,:commissioner_ids,:in_time,:out_time)
end
end