Hey,
This is because you are comparing a string to an integer - params[:id] will be a string whereas p.id will be an integer.
The quick way around this is: if params[:id] == p.id.to_s
... but i'd recommend abstracting this to a helper. Something like this:
in application helper:
def class_if_current(css_class, model) if params[:id] == model.id.to_s "class=\"#{css_class}\" " end end
then in your view:
<li <%= class_if_current("current", p) %>>
Hope that helps,
Steve