orbit-4-2/app/controllers/admin/mail_cron_logs_controller.rb

52 lines
1.4 KiB
Ruby
Raw Permalink Normal View History

2014-03-07 07:15:52 +00:00
class Admin::MailCronLogsController < OrbitBackendController
# layout "new_admin"
before_filter :authenticate_user!
before_filter :is_admin?
def index
# @mail_cron_logs = MailCronLog.all.desc(:created_at).page(params[:page_main] ).per('20')
@mail_cron_logs = (params[:sort]) ? get_sorted_and_filtered("mail_cron_log") : get_viewable("mail_cron_log")
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @mail_crons }
format.js
end
end
2014-03-20 07:08:54 +00:00
def show
@mail_cron_log = MailCronLog.find(params[:id])
respond_to do |format|
format.html # show.html.erb
end
end
2014-03-07 07:15:52 +00:00
def destroy
@mail_cron_log = MailCronLog.find(params[:id])
@mail_cron_log.destroy
respond_to do |format|
# format.html { redirect_to(admin_mail_cron_logs_url) }
# format.xml { head :ok }
format.js { render :layout => false }
end
end
def delete
if params[:ids]
# @mail_cron_logs = MailCronLog.any_in(:_id => params[:ids]).destroy_all
@mail_cron_logs = MailCronLog.any_in(:_id => params[:ids])
end
respond_to do |format|
format.js { render :layout => false }
end
# redirect_to admin_mail_cron_logs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
end