mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-08 14:11:42 +08:00
init project
This commit is contained in:
28
app/controllers/admins/contact_us_controller.rb
Normal file
28
app/controllers/admins/contact_us_controller.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class Admins::ContactUsController < Admins::BaseController
|
||||
def edit
|
||||
@cooperations = Cooperation.all.group(:user_type)
|
||||
@help = Help.first
|
||||
end
|
||||
|
||||
def update
|
||||
cooperation = Cooperation.find(params[:id])
|
||||
cooperation.update!(update_cooperation_params)
|
||||
|
||||
flash[:success] = '保存成功'
|
||||
redirect_to edit_admins_contact_us_path
|
||||
end
|
||||
|
||||
def update_address
|
||||
help = Help.first || Help.create
|
||||
help.update!(status: params.dig('help', 'status'))
|
||||
|
||||
flash[:success] = '保存成功'
|
||||
redirect_to edit_admins_contact_us_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_cooperation_params
|
||||
params.require(:cooperation).permit(:name, :qq, :mail)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user