Class: Vimo::ItemsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#max_per_page, #page, #per_page

Instance Method Details

#createObject



20
21
22
23
# File 'app/controllers/vimo/items_controller.rb', line 20

def create
  @item = items.build
  save_and_respond
end

#destroyObject



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

def destroy
  @item.destroy
  respond_with @entity, @item
end

#indexObject



11
12
13
14
# File 'app/controllers/vimo/items_controller.rb', line 11

def index
  @items = @entity.items.page(page).per(per_page)
  respond_with @entity, @items
end

#showObject



16
17
18
# File 'app/controllers/vimo/items_controller.rb', line 16

def show
  respond_with @entity, @item
end

#updateObject



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

def update
  save_and_respond
end