Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Edmundo Ramirez-Semprit's Profile

GitHub User: mscpr

Site: www.mscpr.com

Comments by Edmundo Ramirez-Semprit

Avatar

There is an error in the ASCII version

def load_commentable
resource, id = request.path.split('/')[1,2]
@commentable = resource.singularize.classify.contantize.find(1)
end

should be:

def load_commentable
resource, id = request.path.split('/')[1,2]
@commentable = resource.singularize.classify.constantize.find(id)
end

change contantize to constantize and put id between parenthesis.