Glove.class_name => 'Glofe'

I'm trying to class array to another array. However Glove.class_name become 'Glofe'. Somebody can tell me why?

My environment is ruby 1.8.6 Rails 2.2.2 on Windows Vista.

Hi Masuda,

class_name isn't a real method, try Glove.class.name instead.

Hi Bill.

Thanks for your reply.

I guessed so too, but plural form of glove is 'gloves' isn't it? In addition, I found Mustache.class_name becomes 'Mustach' (lack of last 'e').

I think it's odd.

Thanks for youre reply but ... Glove.class.name returns "Class", not a class name.

Ops, i meant Glove.name

Thanks for your help. It works fine !!

Hi Masuda,

Hi Bill.

Thanks for your reply.

You're welcome. Sorry I couldn't be more help.

I guessed so too, but plural form of glove is 'gloves' isn't it? In addition, I found Mustache.class_name becomes 'Mustach' (lack of last 'e').

I think it's odd.

It is odd. And yes, the correct plural (in American English) of glove is gloves. But as you discovered, Rails pluralization is sometimes a bit 'off'. That's why I take a look there first when I get weird results like yours. It's just a quick way to rule out something simple. Glad you got the help you needed.

Best regards, Bill