diff --git a/lib/PostText/Controller/Remark.pm b/lib/PostText/Controller/Remark.pm index d06293e..f9547d5 100644 --- a/lib/PostText/Controller/Remark.pm +++ b/lib/PostText/Controller/Remark.pm @@ -29,6 +29,11 @@ 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, @@ -39,10 +44,7 @@ sub create($self) { $self->thread->bump($thread_id); - return $self->redirect_to(single_thread => { - thread_id => $thread_id, - thread_page => $self->remark->last_page_for($thread_id) - }); + return $self->redirect_to($thread_url); } } diff --git a/templates/thread/by_id.html.ep b/templates/thread/by_id.html.ep index 5755b39..567c2f8 100644 --- a/templates/thread/by_id.html.ep +++ b/templates/thread/by_id.html.ep @@ -13,7 +13,7 @@ <%= link_to Remark => post_remark => {thread_id => $thread->{'id'}} %> <% if (my $first_remark = $remarks->[0]) { =%> -
+

Remarks

<% for my $remark (@{$remarks}) { =%>
diff --git a/templates/thread/by_page.html.ep b/templates/thread/by_page.html.ep index 667cee4..b5e007d 100644 --- a/templates/thread/by_page.html.ep +++ b/templates/thread/by_page.html.ep @@ -14,7 +14,8 @@

<%= truncate_text $thread->{'body'} %>