pseudo_member/app/controllers/admin/pseudo_members_controller.rb

32 lines
831 B
Ruby

class Admin::PseudoMembersController < OrbitAdminController
def index
@table_fields = ["pseudo_member.name", "pseudo_member.user_name", "pseudo_member.last_login"]
@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