epaper/app/controllers/admin/e_paper_subscribers_control...

28 lines
745 B
Ruby
Raw Normal View History

2019-05-28 15:54:32 +00:00
class Admin::EPaperSubscribersController < OrbitAdminController
def initialize
super
@app_title = "e_paper"
end
def index
@table_fields = [t('email'), t('status'), t('language')]
@filter_fields = filter_fields([], [])
@filter_fields.delete(:status)
@filter_fields.delete(:category)
@filter_fields.delete(:tags)
@subscribers = EPaperSubscriber.order_by(sort)
@subscribers = search_data(@subscribers,[:email]).page(params[:page]).per(10)
render :partial => "index" if request.xhr?
end
def destroy
subscriber = EPaperSubscriber.find(params[:id]) rescue nil
if !subscriber.nil?
subscriber.destroy
end
redirect_to admin_e_paper_subscribers_path
end
end