Class: Socializer::CommentsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
# File 'app/controllers/socializer/comments_controller.rb', line 9

def create
  @comment = current_user.comments.build(params[:comment])
  @comment.activity_verb = 'add'
  # TODO: Is scope needed? Try commenting it out to see what happens
  @comment.scope = Audience.privacy_level.find_value(:public)
  @comment.save!
  redirect_to stream_path
end

#destroyObject



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

def destroy
  @comment.destroy
  redirect_to stream_path
end

#editObject



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

def edit
end

#newObject



5
6
7
# File 'app/controllers/socializer/comments_controller.rb', line 5

def new
  @comment = Comment.new
end

#updateObject



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

def update
  @comment.update!(params[:comment])
  redirect_to stream_path
end