1
我正在寫一個rails視圖。它是一個表格收集信用卡的細節。它使用braintree.js客戶端加密來確保信用卡信息在離開客戶端機器之前被加密。 (信用卡的詳細信息不是不屬於型號的一部分)自定義屬性select_year幫助程序或使用javascript滾動我自己
但是,對於加密工作,「name」屬性需要更改爲類似於以下內容的「data-encrypted-name」。
<div class="field">
<label>Card Number</label>
<input type="text" size="20" autocomplete="off" data-encrypted-name="number" />
</div>
我有信用卡領域沒有問題......然而,隨着到期年字段我目前使用select_year幫手,因爲它填充選項的右側列表。不過,我不認爲這是可能的使用select_year幫手時添加自定義屬性...
<%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+10}, {name: 'year', id: "card_year"}%>
是JavaScript動態創建的選擇輸入的最佳替代方式填充與正確的選項,並有「數據加密-name'屬性?