Class: AdminController

Inherits:
AdminCartoonistController show all
Defined in:
app/controllers/admin_controller.rb

Instance Method Summary collapse

Instance Method Details

#cronObject



23
24
25
26
27
28
29
# File 'app/controllers/admin_controller.rb', line 23

def cron
  Cartoonist::Cron.all.each &:call
  render :text => "Success.", :layout => false
rescue => e
  logger.error "Failure running cron: #{e}\n  #{e.backtrace.join "\n  "}"
  render :text => "Failure.", :layout => false
end

#mainObject



19
20
21
# File 'app/controllers/admin_controller.rb', line 19

def main
  render :layout => "general_admin"
end

#reloadObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/admin_controller.rb', line 9

def reload
  if Rails.env.production?
    %x[git pull]
    %x[touch #{File.join Rails.root, "tmp/restart.txt"}]
    flash[:message] = "Updated and restarted."
  end

  redirect_to "/admin/main"
end

#showObject



5
6
7
# File 'app/controllers/admin_controller.rb', line 5

def show
  redirect_to "/admin/main"
end