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/shixun_recycles_controller.rb

23 lines
601 B

class Admins::ShixunRecyclesController < Admins::BaseController
def index
sort_by = params[:sort_by].presence || 'created_at'
sort_direction = params[:sort_direction].presence || 'desc'
search = params[:search].to_s.strip
shixuns = Shixun.where(status: -1).where("name like ?", "%#{search}%").order("#{sort_by} #{sort_direction}")
@shixuns = paginate shixuns.preload(:user, :laboratory)
end
def destroy
Shixun.find(params[:id]).destroy!
render_delete_success
end
def resume
Shixun.find(params[:id]).update!(status: 0)
render_delete_success
end
end