Class: MetaController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- MetaController
- Defined in:
- app/controllers/meta_controller.rb
Overview
Handles CRUD operations for Metum objects
Instance Method Summary collapse
-
#create ⇒ Object
POST /meta.
-
#edit ⇒ Object
GET /meta/1/edit.
-
#index ⇒ Object
GET /meta.
-
#new ⇒ Object
GET /meta/new.
-
#show ⇒ Object
GET /meta/1.
-
#update ⇒ Object
PATCH /meta/1.
Instance Method Details
#create ⇒ Object
POST /meta
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/meta_controller.rb', line 28 def create self.metum = current_organization..new(metum_params) if metum.save logger.info "Created #{metum}" redirect_to [current_organization, metum], notice: 'Metum was successfully created.' else logger.warn "Unable to create Metum: '#{metum.error_sentence}'" render :new end end |
#edit ⇒ Object
GET /meta/1/edit
24 25 |
# File 'app/controllers/meta_controller.rb', line 24 def edit end |
#index ⇒ Object
GET /meta
11 12 |
# File 'app/controllers/meta_controller.rb', line 11 def index end |
#new ⇒ Object
GET /meta/new
19 20 21 |
# File 'app/controllers/meta_controller.rb', line 19 def new self.metum = current_organization..new end |
#show ⇒ Object
GET /meta/1
15 16 |
# File 'app/controllers/meta_controller.rb', line 15 def show end |
#update ⇒ Object
PATCH /meta/1
41 42 43 44 45 46 47 48 |
# File 'app/controllers/meta_controller.rb', line 41 def update if metum.update(metum_params) redirect_to [current_organization, metum], notice: 'Metum was successfully updated.' else logger.warn "Unable to update #{metum}: '#{metum.error_sentence}'" render :edit end end |