Module: ForemanDatacenter::CommentsHelper

Defined in:
app/helpers/foreman_datacenter/comments_helper.rb

Instance Method Summary collapse

Instance Method Details

#commentable_path(comment) ⇒ Object



3
4
5
6
# File 'app/helpers/foreman_datacenter/comments_helper.rb', line 3

def commentable_path(comment)
  resource = comment.commentable.class.to_s.gsub("ForemanDatacenter::","").pluralize.split(/(?<!\s)(?=[A-Z])/).join('_').downcase
  "/datacenter/#{resource}/#{comment.commentable.id}#comment-#{comment.id}"
end