You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/controllers/admins/contact_us_controller.rb

28 lines
668 B

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