Class: UsersController
- Inherits:
-
MVCLI::Controller
- Object
- MVCLI::Controller
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/controllers/users_controller.rb', line 10 def create template = Users::CreateForm argv = MVCLI::Argv.new command.argv form = template.new argv. form.validate! instance.users.create form.value end |
#destroy ⇒ Object
24 25 26 27 28 29 |
# File 'app/controllers/users_controller.rb', line 24 def destroy list = users list.instance = instance user = list.all.find { |u| u.name == params[:id] } user.destroy or fail Fog::Errors::NotFound end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/users_controller.rb', line 6 def index instance.users.all end |
#show ⇒ Object
18 19 20 21 22 |
# File 'app/controllers/users_controller.rb', line 18 def show list = users list.instance = instance list.all.find { |u| u.name == params[:id] } or fail Fog::Errors::NotFound end |