Class: DatabasesController
- Inherits:
-
MVCLI::Controller
- Object
- MVCLI::Controller
- DatabasesController
- Defined in:
- app/controllers/databases_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/databases_controller.rb', line 18 def create template = Databases::CreateForm argv = MVCLI::Argv.new command.argv form = template.new argv. form.validate! d = databases d.instance = instance d.create ({name: form.name}) end |
#destroy ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/databases_controller.rb', line 29 def destroy d = databases d.instance = instance db = find_database_in(d) db.destroy return db end |
#index ⇒ Object
6 7 8 9 10 |
# File 'app/controllers/databases_controller.rb', line 6 def index d = databases d.instance = instance d.all end |
#show ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/databases_controller.rb', line 12 def show d = databases d.instance = instance find_database_in d end |