Class: Apidae::ObjectsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Apidae::ObjectsController
- Defined in:
- app/controllers/apidae/objects_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /objects.
-
#destroy ⇒ Object
DELETE /objects/1.
-
#edit ⇒ Object
GET /objects/1/edit.
-
#index ⇒ Object
GET /objects.
-
#new ⇒ Object
GET /objects/new.
-
#show ⇒ Object
GET /objects/1.
-
#update ⇒ Object
PATCH/PUT /objects/1.
Instance Method Details
#create ⇒ Object
POST /objects
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/apidae/objects_controller.rb', line 26 def create @object = Object.new(object_params) if @object.save redirect_to @object, notice: 'Object was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /objects/1
46 47 48 49 |
# File 'app/controllers/apidae/objects_controller.rb', line 46 def destroy @object.destroy redirect_to objects_url, notice: 'Object was successfully destroyed.' end |
#edit ⇒ Object
GET /objects/1/edit
22 23 |
# File 'app/controllers/apidae/objects_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /objects
8 9 10 |
# File 'app/controllers/apidae/objects_controller.rb', line 8 def index @objects = Object.all end |
#new ⇒ Object
GET /objects/new
17 18 19 |
# File 'app/controllers/apidae/objects_controller.rb', line 17 def new @object = Object.new end |
#show ⇒ Object
GET /objects/1
13 14 |
# File 'app/controllers/apidae/objects_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /objects/1
37 38 39 40 41 42 43 |
# File 'app/controllers/apidae/objects_controller.rb', line 37 def update if @object.update(object_params) redirect_to @object, notice: 'Object was successfully updated.' else render :edit end end |