Sha256: 5efedb750996fec1970310e6bbe0f9db0aea49235ce44da63d934aa835e43aa9
Contents?: true
Size: 1.33 KB
Versions: 10
Compression:
Stored size: 1.33 KB
Contents
class OrgDepartmentsController < ApplicationController before_action :set_org_department, only: [:show, :edit, :update, :destroy] # GET /org_departments def index @org_departments = OrgDepartment.all end # GET /org_departments/1 def show end # GET /org_departments/new def new @org_department = OrgDepartment.new end # GET /org_departments/1/edit def edit end # POST /org_departments def create @org_department = OrgDepartment.new(org_department_params) if @org_department.save redirect_to @org_department, notice: 'Org department was successfully created.' else render :new end end # PATCH/PUT /org_departments/1 def update if @org_department.update(org_department_params) redirect_to @org_department, notice: 'Org department was successfully updated.' else render :edit end end # DELETE /org_departments/1 def destroy @org_department.destroy redirect_to org_departments_url, notice: 'Org department was successfully destroyed.' end private # Use callbacks to share common setup or constraints between actions. def set_org_department @org_department = OrgDepartment.find(params[:id]) end # Only allow a trusted parameter "white list" through. def org_department_params params[:org_department] end end
Version data entries
10 entries across 10 versions & 1 rubygems