Class: Homeland::RepliesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #homeland_require_user

Instance Method Details

#editObject



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

def edit
  @reply = current_user.replies.find(params[:id])
end

#updateObject



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

def update
  @reply = current_user.replies.find(params[:id])

  if @reply.update_attributes(params[:reply])
    redirect_to(topic_path(@reply.topic_id,:anchor => "reply#{@reply.topic.replies_count}"), :notice => '回帖更新成功.')
  else
    render :action => "edit"
  end
end