foodsoft/app/controllers/foodcoop/workgroups_controller.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00

21 lines
514 B
Ruby

class Foodcoop::WorkgroupsController < ApplicationController
before_action :authenticate_membership_or_admin,
except: [:index]
def index
@workgroups = Workgroup.order('name')
end
def edit
@workgroup = Workgroup.find(params[:id])
end
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
end