Ruby WTF


Uncategorized / Sunday, September 30th, 2012

<%= link_to comment.comment, polymorphic_path(comment.commentable_type.capitalize.constantize.find(comment.commentable_id)) %>

I just wrote this line in Ruby. It makes my head swim a little.

Surely there is a better way of doing this, but I don’t know it.