Class: Vimo::EntitiesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#max_per_page, #page, #per_page

Instance Method Details

#createObject



19
20
21
22
# File 'app/controllers/vimo/entities_controller.rb', line 19

def create
  @entity = entities_scope.create(entity_params)
  respond_with @entity
end

#destroyObject



29
30
31
32
# File 'app/controllers/vimo/entities_controller.rb', line 29

def destroy
  @entity.destroy
  respond_with @entity
end

#indexObject



10
11
12
13
# File 'app/controllers/vimo/entities_controller.rb', line 10

def index
  @entities = entities_scope.page(page).per(per_page)
  respond_with @entities
end

#showObject



15
16
17
# File 'app/controllers/vimo/entities_controller.rb', line 15

def show
  respond_with @entity
end

#updateObject



24
25
26
27
# File 'app/controllers/vimo/entities_controller.rb', line 24

def update
  @entity.update(entity_params)
  respond_with @entity
end