pseudo_member/app/controllers/admin/pseudo_members_controller.rb

32 lines
834 B
Ruby
Raw Normal View History

2017-09-21 12:50:17 +00:00
class Admin::PseudoMembersController < OrbitAdminController
def index
2018-01-19 09:08:03 +00:00
@table_fields = ["pseudo_members.name", "pseudo_members.user_name", "pseudo_members.last_login"]
2017-09-21 12:50:17 +00:00
@members = PseudoUser.all.desc(:created_at).page(params[:page]).per(10)
end
def settings
@settings = PseudoMemberSetting.first rescue nil
if @settings.nil?
@settings = PseudoMemberSetting.create
end
end
def update_settings
@settings = PseudoMemberSetting.first
@settings.update_attributes(setting_params)
@settings.save
redirect_to settings_admin_pseudo_members_path
end
def destroy
puser = PseudoUser.find(params[:id])
puser.destroy
redirect_to admin_pseudo_members_path(:page => params[:page])
end
private
def setting_params
params.require(:pseudo_member_setting).permit!
end
end