开发者

glue multiples text boxes into one string

I am coding a web application in ruby on rails. I have a set of text boxes in each one there is a character and i want to glue all these text boxes in order to make one word. Th开发者_运维问答e text boxes are like this :

1 %>

any ideas ??


Well for starters dont use a for loop, they ugly.

Second I wouldn't use the text_field helper rather the text_field tag

<% (1..10).each do |n| %>
 <%= text_field_tag "password[#{n}]" %>
<% end %>

That will return the password all nicely chunked up

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜