RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: RITF
Site: rightintheface.com
Hi @FlintMakal - how about this for nested resources instead?
def find_commentable params.reverse_each do |name, value| if name =~ /(.+)_id$/ return $1.classify.constantize.find(value) end end nil end
Hi @FlintMakal - how about this for nested resources instead?