Class: Burn::BurnController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Burn::BurnController
- Defined in:
- lib/app/controllers/burn/burn_controller.rb
Overview
A simple controller which allows for backups and restores.
-
GET /burn/backup
gets the latest backup -
POST /burn/restore
restores to the backup posted asparams[:backup][:data]
Instance Method Summary collapse
-
#backup ⇒ Object
Gets the latest backup.
-
#restore ⇒ Object
Restores from a backup.
Instance Method Details
#backup ⇒ Object
Gets the latest backup
9 10 11 12 13 |
# File 'lib/app/controllers/burn/burn_controller.rb', line 9 def backup respond_to do |format| format.html { send_data build_backup } end end |
#restore ⇒ Object
Restores from a backup
16 17 18 19 20 21 22 |
# File 'lib/app/controllers/burn/burn_controller.rb', line 16 def restore load_backup params[:backup][:data].read respond_to do |format| format.html { head :ok } end end |