Class: Foodcoop::WorkgroupsController

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

Instance Method Summary collapse

Instance Method Details

#editObject


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

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

#indexObject


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

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

#updateObject


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

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