From d9bbcf6baefcce552a3899205a375fcbff2764a8 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Tue, 23 Aug 2022 21:48:30 -0400 Subject: [PATCH] Another Remark hyperlink and finally figured out link_to() smh --- README.md | 7 +------ templates/view_page.html.ep | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a1aafb4..a8634cb 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,9 @@ Run the tests locally (against development environment) ## TODOs -1. Hyperlink to remarks form 1. Is there something I can do about route names? -1. I'm kinda hardcoding the single-thread view `link_to` in the - templates because I cannot for the life of me figure out how to use - `url_for` to populate the `thread_id` placeholder. Probably need to - clean-up the HTML too, just used `` cuz I didn't know what - else to use 1. Tests for remark form +1. Return the last remark with remark form 1. Marked some items for clean up with comments 1. Method names may need to be shortened 1. Change 'view' to something like 'list' or 'browse' diff --git a/templates/view_page.html.ep b/templates/view_page.html.ep index c83d119..6bb0d87 100644 --- a/templates/view_page.html.ep +++ b/templates/view_page.html.ep @@ -5,12 +5,14 @@ <% for my $thread (@$threads) { =%>
- <%= link_to '#' . %$thread{'id'}, '/thread/' . %$thread{'id'} %> + <%= link_to "#$thread->{'id'}", + thread_idremark_page => {thread_id => $thread->{'id'}} %>

<%= %$thread{'title'} %>

<%= %$thread{'date'} %>

<%= %$thread{'author'} %>

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

+ <%= link_to Remark => thread_id => {thread_id => $thread->{'id'}} %>
<% } =%>