Class: Foodcoop::WorkgroupsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foodcoop/workgroups_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



9
10
11
# File 'app/controllers/foodcoop/workgroups_controller.rb', line 9

def edit
  @workgroup = Workgroup.find(params[:id])
end

#indexObject



5
6
7
# File 'app/controllers/foodcoop/workgroups_controller.rb', line 5

def index
  @workgroups = Workgroup.order('name')
end

#updateObject



13
14
15
16
17
18
19
20
# File 'app/controllers/foodcoop/workgroups_controller.rb', line 13

def update
  @workgroup = Workgroup.find(params[:id])
  if @workgroup.update(params[:workgroup])
    redirect_to foodcoop_workgroups_url, notice: I18n.t('workgroups.update.notice')
  else
    render action: 'edit'
  end
end