开发者

Rails how to make a number (3) to a variable (three)?

开发者 https://www.devze.com 2023-03-19 09:20 出处:网络
I am trying to create some javascript links. I need to transform the ID of a object to a variable. For example:

I am trying to create some javascript links.

I need to transform the ID of a object to a variable.

For example:

Company.id = 3 

I want to transform the ID to a variable like three in the view.开发者_如何学编程


Your best bet would be to use the functionality provided by the Ruby Linguistics Project:

English - Ruby Linguistics

companyLinkValue = Company.id.en.numwords
0

精彩评论

暂无评论...
验证码 换一张
取 消