开发者

Ruby, Getting a list count from a Param?

in my Rails 3 app, I have a form that posts XXX,XXXXXXXX What I want to be able to do is something like so:

params[开发者_开发百科:myfield].count
or 
params[:myfield].size

But that always returns 1, how can I get a count for the number of items by comma separation?

Thanks


params[:myfield].split(",").size
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜