personal_other_paper/app/controllers/admin/other_paper_statuses_contro...

43 lines
994 B
Ruby

class Admin::OtherPaperStatusesController < OrbitMemberController
def index
end
def new
@other_paper_status = OtherPaperStatus.new
@url = admin_other_paper_statuses_path
end
def edit
@other_paper_status = OtherPaperStatus.find(params[:id])
@url = admin_other_paper_status_path(@other_paper_status)
end
def create
other_paper_status = OtherPaperStatus.create(other_paper_status_params)
@other_paper_statuses = OtherPaperStatus.all
end
def update
other_paper_status = OtherPaperStatus.find(params[:id]) rescue nil
if !other_paper_status.nil?
other_paper_status.update_attributes(other_paper_status_params)
end
@other_paper_statuses = OtherPaperStatus.all
end
def destroy
other_paper_status = OtherPaperStatus.find(params[:id]) rescue nil
if !other_paper_status.nil?
other_paper_status.destroy
end
@other_paper_statuses = OtherPaperStatus.all
end
private
def other_paper_status_params
params.require(:other_paper_status).permit!
end
end