JC: fixed a bug in converting params[:controller] to model name.