28 lines
745 B
Ruby
28 lines
745 B
Ruby
|
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
|