2009-08-02 18:42:52 +02:00
|
|
|
class Foodcoop::WorkgroupsController < ApplicationController
|
2019-10-28 21:11:35 +01:00
|
|
|
before_action :authenticate_membership_or_admin,
|
2021-03-01 15:27:26 +01:00
|
|
|
:except => [:index]
|
2009-08-02 18:42:52 +02:00
|
|
|
|
|
|
|
def index
|
2014-02-20 15:04:53 +01:00
|
|
|
@workgroups = Workgroup.order("name")
|
2009-08-02 18:42:52 +02:00
|
|
|
end
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2009-08-02 18:42:52 +02:00
|
|
|
def edit
|
|
|
|
@workgroup = Workgroup.find(params[:id])
|
|
|
|
end
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2009-08-02 18:42:52 +02:00
|
|
|
def update
|
|
|
|
@workgroup = Workgroup.find(params[:id])
|
2022-10-13 18:25:52 +02:00
|
|
|
if @workgroup.update(params[:workgroup])
|
2013-02-13 01:32:48 +01:00
|
|
|
redirect_to foodcoop_workgroups_url, :notice => I18n.t('workgroups.update.notice')
|
2009-08-02 18:42:52 +02:00
|
|
|
else
|
|
|
|
render :action => 'edit'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|