Class: MetaController

Inherits:
ApplicationController show all
Defined in:
app/controllers/meta_controller.rb

Overview

Handles CRUD operations for Metum objects

See Also:

Instance Method Summary collapse

Instance Method Details

#createObject

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.meta.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

#editObject

GET /meta/1/edit



24
25
# File 'app/controllers/meta_controller.rb', line 24

def edit
end

#indexObject

GET /meta



11
12
# File 'app/controllers/meta_controller.rb', line 11

def index
end

#newObject

GET /meta/new



19
20
21
# File 'app/controllers/meta_controller.rb', line 19

def new
  self.metum = current_organization.meta.new
end

#showObject

GET /meta/1



15
16
# File 'app/controllers/meta_controller.rb', line 15

def show
end

#updateObject

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