Class: Homeland::RepliesController
Instance Method Summary
collapse
#current_user, #homeland_require_user
Instance Method Details
#edit ⇒ Object
6
7
8
|
# File 'app/controllers/homeland/replies_controller.rb', line 6
def edit
@reply = current_user.replies.find(params[:id])
end
|
#update ⇒ Object
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
|