Module: Burn::RoutingExtension
- Defined in:
- lib/routing_extension.rb
Overview
Adds two simple routes for fetching backups and restoring from backups
ActionController::Routing::Routes.draw do |map|
# Creates both the backup and restore routes
map.burn
# You can create them individually if you need to.
map.burn_backup # Creates the backup route 'GET /burn/backup'
map.burn_restore # Creates the restore route 'POST /burn/restore'
end
Instance Method Summary collapse
Instance Method Details
#burn ⇒ Object
21 22 23 24 |
# File 'lib/routing_extension.rb', line 21 def burn burn_backup burn_restore end |
#burn_backup ⇒ Object
13 14 15 |
# File 'lib/routing_extension.rb', line 13 def burn_backup @set.add_route '/burn/backup', :controller => 'burn/burn', :action => "backup", :method => :get end |
#burn_restore ⇒ Object
17 18 19 |
# File 'lib/routing_extension.rb', line 17 def burn_restore @set.add_route '/burn/restore', :controller => 'burn/burn', :action => "restore", :method => :post end |