【发布时间】:2014-03-23 17:00:43
【问题描述】:
这里是integer和character组合的随机数代码
<%=(0...4).map { ('a'..'z').to_a[rand(26)] }.join %> <%=rand(1..2000)%>
提供如下输出:
tqzu 1664
但是当我把它放入文本框时;
<input type = "text" value=<%=(0...4).map { ('a'..'z').to_a[rand(26)] }.join %><%=rand(1..2000)%> />
输出
ztgg
问题:-
how to get the value of random number into textbox with the combination of char and integer?
【问题讨论】:
标签: ruby random ruby-on-rails-4 textbox