Class: LesliBabel::ModulesController
- Inherits:
-
ApplicationController
- Object
- Lesli::ApplicationLesliController
- ApplicationController
- LesliBabel::ModulesController
- Defined in:
- app/controllers/lesli_babel/modules_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /modules.
-
#destroy ⇒ Object
DELETE /modules/1.
-
#edit ⇒ Object
GET /modules/1/edit.
-
#index ⇒ Object
GET /modules.
-
#new ⇒ Object
GET /modules/new.
-
#show ⇒ Object
GET /modules/1.
-
#update ⇒ Object
PATCH/PUT /modules/1.
Instance Method Details
#create ⇒ Object
POST /modules
63 64 65 66 67 68 69 70 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 63 def create new_module = Module.new(module_params) if new_module.save respond_with_successful(new_module) else respond_with_error("Error on create module", new_module.errors) end end |
#destroy ⇒ Object
DELETE /modules/1
82 83 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 82 def destroy end |
#edit ⇒ Object
GET /modules/1/edit
59 60 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 59 def edit end |
#index ⇒ Object
GET /modules
38 39 40 41 42 43 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 38 def index respond_to do |format| format.html { } format.json { respond_with_successful(Module.index) } end end |
#new ⇒ Object
GET /modules/new
54 55 56 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 54 def new @module = Module.new end |
#show ⇒ Object
GET /modules/1
46 47 48 49 50 51 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 46 def show respond_to do |format| format.html { } format.json { respond_with_successful(@module.show) } end end |
#update ⇒ Object
PATCH/PUT /modules/1
73 74 75 76 77 78 79 |
# File 'app/controllers/lesli_babel/modules_controller.rb', line 73 def update if @module.update(module_params) redirect_to @module, notice: 'Module was successfully updated.' else render :edit end end |