Class: Jabe::CommentsController

Inherits:
Admin::BaseController show all
Defined in:
app/controllers/jabe/comments_controller.rb

Instance Method Summary collapse

Methods included from PublicEntryUrl

included, #public_entry_url

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/jabe/comments_controller.rb', line 7

def create
  if comment.save
    comment.send_notification(request)
    redirect_to entry_path(entry), :notice => 'Your comment was submitted.'
  else
    flash[:error] = 'Unable to submit your comment.'
    render 'entries/show'
  end
end

#destroyObject



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

def destroy
  comment.destroy
  redirect_to entry_path(entry), :notice => 'Comment was deleted.'
end