Files
sx-fc/app/controllers/origami/in_juties_controller.rb
Zin Lin Phyo 874a9b60be create InJuty
2017-08-23 15:02:27 +06:30

75 lines
1.9 KiB
Ruby

class Origami::InJutiesController < BaseOrigamiController
before_action :set_in_juty, only: [:show, :edit, :update, :destroy]
# GET /in_juties
# GET /in_juties.json
def index
@in_juties = InJuty.all
end
# GET /in_juties/1
# GET /in_juties/1.json
def show
end
# GET /in_juties/new
def new
@in_juty = InJuty.new
end
# GET /in_juties/1/edit
def edit
end
# POST /in_juties
# POST /in_juties.json
def create
@in_juty = InJuty.new(in_juty_params)
respond_to do |format|
if @in_juty.save
format.html { redirect_to @in_juty, 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
# PATCH/PUT /in_juties/1.json
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.json { render :show, status: :ok, location: @in_juty }
else
format.html { render :edit }
format.json { render json: @in_juty.errors, status: :unprocessable_entity }
end
end
end
# DELETE /in_juties/1
# DELETE /in_juties/1.json
def destroy
@in_juty.destroy
respond_to do |format|
format.html { redirect_to in_juties_url, notice: 'In juty was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_in_juty
@in_juty = InJuty.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def in_juty_params
params.fetch(:in_juty, {})
end
end