Class: IntegrationPal::WorkersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IntegrationPal::WorkersController
- Defined in:
- app/controllers/integration_pal/workers_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /workers.
-
#destroy ⇒ Object
DELETE /workers/1.
-
#edit ⇒ Object
GET /workers/1/edit.
-
#index ⇒ Object
GET /workers.
-
#new ⇒ Object
GET /workers/new.
-
#show ⇒ Object
GET /workers/1.
-
#update ⇒ Object
PATCH/PUT /workers/1.
Methods inherited from ApplicationController
#require_user, #skip_authentication?
Instance Method Details
#create ⇒ Object
POST /workers
26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 26 def create @worker = Worker.new(worker_params) @worker.settings = params[:worker][:settings] || {} if @worker.save redirect_to @worker, notice: 'Worker was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /workers/1
48 49 50 51 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 48 def destroy @worker.destroy redirect_to workers_url, notice: 'Worker was successfully destroyed.' end |
#edit ⇒ Object
GET /workers/1/edit
22 23 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /workers
8 9 10 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 8 def index @workers = Worker.all end |
#new ⇒ Object
GET /workers/new
17 18 19 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 17 def new @worker = Worker.new end |
#show ⇒ Object
GET /workers/1
13 14 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /workers/1
38 39 40 41 42 43 44 45 |
# File 'app/controllers/integration_pal/workers_controller.rb', line 38 def update @worker.settings = params[:worker][:settings] || {} if @worker.update(worker_params) redirect_to @worker, notice: 'Worker was successfully updated.' else render :edit end end |