开发者

glue multiples text boxes into one string

开发者 https://www.devze.com 2023-03-18 09:58 出处:网络
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.

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

精彩评论

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

关注公众号