Class: AdminController
- Inherits:
-
AdminCartoonistController
- Object
- ActionController::Base
- CartoonistController
- AdminCartoonistController
- AdminController
- Defined in:
- app/controllers/admin_controller.rb
Instance Method Summary collapse
Instance Method Details
#backup ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/admin_controller.rb', line 9 def backup respond_to do |format| format.html { redirect_to "/admin/main" } format.tgz do backup = Backup.new :tgz headers["Content-Disposition"] = backup.content_disposition self.response_body = backup.response_body end format.zip do backup = Backup.new :zip headers["Content-Disposition"] = backup.content_disposition self.response_body = backup.response_body end end end |
#cron ⇒ Object
41 42 43 44 45 46 47 |
# File 'app/controllers/admin_controller.rb', line 41 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 |
#main ⇒ Object
37 38 39 |
# File 'app/controllers/admin_controller.rb', line 37 def main render :layout => "general_admin" end |
#reload ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/admin_controller.rb', line 27 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 |
#show ⇒ Object
5 6 7 |
# File 'app/controllers/admin_controller.rb', line 5 def show redirect_to "/admin/main" end |