Class: CommentsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @comment.save
  respond_with(@comment, respond_options)
end

#destroyObject



30
31
32
33
# File 'app/controllers/comments_controller.rb', line 30

def destroy
  @comment.destroy
  respond_with(@comment, respond_options)
end

#editObject



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

def edit
  respond_with(@comment)
end

#newObject



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

def new
  respond_with(@comment)
end

#updateObject



25
26
27
28
# File 'app/controllers/comments_controller.rb', line 25

def update
  @comment.update_attributes(params[:comment])
  respond_with(@comment, respond_options)
end