Class: Homeland::RepliesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/homeland/replies_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#admin?, #authenticate_user!, #authorize_admin!, #authorize_resource!, #current_user, #owner?, #set_seo_meta

Instance Method Details

#destroyObject



19
20
21
22
# File 'app/controllers/homeland/replies_controller.rb', line 19

def destroy
  reply.destroy
  redirect_to(topic_path(reply.topic_id), notice: t('homeland.reply_deleted'))
end

#editObject



8
9
# File 'app/controllers/homeland/replies_controller.rb', line 8

def edit
end

#updateObject



11
12
13
14
15
16
17
# File 'app/controllers/homeland/replies_controller.rb', line 11

def update
  if reply.update_attributes(reply_params)
    redirect_to(topic_path(reply.topic_id, anchor: "reply-#{reply.id}"), notice: t('homeland.reply_updated'))
  else
    render action: "edit"
  end
end