ShehrozIrfan / comment_tree_app

This is the comment tree app using rails, in which the concept of self referential associations is used.
MIT License
7 stars 1 forks source link

Add limit on comment text when showing on main page #48

Closed FaheemAhmedNoor closed 1 year ago

FaheemAhmedNoor commented 2 years ago

I've search for the ruby solution but I was not able to find it.

On Sun, 4 Dec 2022, 1:21 pm Shehroz Irfan, @.***> wrote:

@.**** commented on this pull request.

In app/views/comments/index.html.erb https://github.com/ShehrozIrfan/comment_tree_app/pull/48#discussion_r1038928043 :

@@ -9,7 +9,7 @@ <% @comments.each do |comment| %>

- <%= link_to comment_path(comment.id), class: 'text-dark' do %> <%= comment.text %><% end %> + <%= link_to comment_path(comment.id), class: 'text-dark link' do %> <%= comment.text %><% end %>

Please use a definitive class name, like link is very generalized. You can use comment-text-with-limit

— Reply to this email directly, view it on GitHub https://github.com/ShehrozIrfan/comment_tree_app/pull/48#pullrequestreview-1203615651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYAFYYDGMUBCTAJG4XRQI63WLRIAPANCNFSM6AAAAAASTAD2M4 . You are receiving this because you were mentioned.Message ID: @.***>

ShehrozIrfan commented 2 years ago

Hey @FaheemAhmedNoor , We can use comment.text.truncate(255) and that's it. No need to do a lot of stuff.

ShehrozIrfan commented 1 year ago

@FaheemAhmedNoor Is it possible for you to add the above updates on this weekend?

ShehrozIrfan commented 1 year ago

62