Last active
June 20, 2017 13:59
-
-
Save chensoren/3174715 to your computer and use it in GitHub Desktop.
generate an ordered array of hashes in form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name="linkeys[][eui]" class="sign_input"> | |
<input type="text" name="linkeys[][code]" class="sign_input"> | |
params[:linkeys][0] => {"code"=>"597516F5D90924764645C6D25023ECFC", "eui"=>"C8D2C10000000A03"} | |
# 更复杂的嵌套: | |
<%= text_field_tag "kpi[roas][][goal]", nil, placeholder: 'Goal', class: 'inline' %></div> | |
# 参考链接 | |
1. https://stackoverflow.com/questions/16968509/rails-nested-attributes-array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment