diff --git a/lib/PostText/Controller/Remark.pm b/lib/PostText/Controller/Remark.pm index f9547d5..6ef53ce 100644 --- a/lib/PostText/Controller/Remark.pm +++ b/lib/PostText/Controller/Remark.pm @@ -29,11 +29,6 @@ sub create($self) { $self->stash(status => 400) } else { - my $thread_url = $self->url_for(single_thread => { - thread_id => $thread_id, - thread_page => $self->remark->last_page_for($thread_id) - })->fragment('remarks'); - $self->remark->create( $thread_id, $remark_author, @@ -44,7 +39,10 @@ sub create($self) { $self->thread->bump($thread_id); - return $self->redirect_to($thread_url); + return $self->redirect_to($self->url_for(single_thread => { + thread_id => $thread_id, + thread_page => $self->remark->last_page_for($thread_id) + })->fragment('remarks')); } }