2009-08-02 18:42:52 +02:00
|
|
|
class Foodcoop::WorkgroupsController < ApplicationController
|
|
|
|
|
|
|
|
before_filter :authenticate_membership_or_admin,
|
|
|
|
:except => [:index]
|
|
|
|
|
|
|
|
def index
|
2014-02-20 15:04:53 +01:00
|
|
|
@workgroups = Workgroup.order("name")
|
2009-08-02 18:42:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def edit
|
|
|
|
@workgroup = Workgroup.find(params[:id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@workgroup = Workgroup.find(params[:id])
|
|
|
|
if @workgroup.update_attributes(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
|