RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: mscpr
Site: www.mscpr.com
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.
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.