adds helper to fix links to commentable
This commit is contained in:
@@ -20,6 +20,14 @@ module CommentsHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def commentable_path(comment)
|
||||||
|
if comment.commentable_type == "Budget::Investment"
|
||||||
|
budget_investment_path(comment.commentable.budget_id, comment.commentable)
|
||||||
|
else
|
||||||
|
comment.commentable
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def user_level_class(comment)
|
def user_level_class(comment)
|
||||||
if comment.as_administrator?
|
if comment.as_administrator?
|
||||||
"is-admin"
|
"is-admin"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column margin-top">
|
<div class="small-12 column margin-top">
|
||||||
<%= link_to @comment.commentable, class: "back" do %>
|
<%= link_to commentable_path(@comment), class: "back" do %>
|
||||||
<span class="icon-angle-left"></span>
|
<span class="icon-angle-left"></span>
|
||||||
<%= t("comments.show.return_to_commentable") + @comment.commentable.title %>
|
<%= t("comments.show.return_to_commentable") + @comment.commentable.title %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user