diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index b6d066935..14dabf49c 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -1,11 +1,11 @@ module CommentsHelper - def comment_link_text(parent) - parent.is_a? Comment ? t("comments_helper.reply_link") : t("comments_helper.comment_link") + def comment_link_text(parent_id) + parent_id.present? ? t("comments_helper.reply_link") : t("comments_helper.comment_link") end - def comment_button_text(parent) - parent.is_a? Comment ? t("comments_helper.reply_button") : t("comments_helper.comment_button") + def comment_button_text(parent_id) + parent_id.present? ? t("comments_helper.reply_button") : t("comments_helper.comment_button") end end \ No newline at end of file diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index e21b148bc..e02cb4c48 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -88,14 +88,14 @@ <%= render 'comments/actions', comment: comment %> - <%= render 'comments/form', {parent: comment, toggeable: true} %> + <%= render 'comments/form', {commentable: @debate, parent_id: comment.id, toggeable: true} %> <% end %> <% end %>