Class: Projects::UpdatesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/projects/updates_controller.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



25
26
27
# File 'app/controllers/projects/updates_controller.rb', line 25

def collection
  @updates ||= end_of_association_chain.visible_to(current_user)
end

#createObject



16
17
18
19
# File 'app/controllers/projects/updates_controller.rb', line 16

def create
  @update = parent.updates.create(params[:update].merge!(user: current_user))
  render @update
end

#destroyObject



21
22
23
# File 'app/controllers/projects/updates_controller.rb', line 21

def destroy
  destroy!{|format| return index }
end

#indexObject



12
13
14
# File 'app/controllers/projects/updates_controller.rb', line 12

def index
  render end_of_association_chain.page(params[:page]).per(3)
end

#showObject



8
9
10
# File 'app/controllers/projects/updates_controller.rb', line 8

def show
  render resource
end