Ruby WTF


Uncategorized

<%= 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.

September 30, 2012