json.parse
def create
@contract = Contract.new(contract_params)
require 'json'
@contract.save!
JSON.parse(params[:whitelist]).each do |address|
NftOwner.create auth_type: 'address', auth_value: address, contract_id: @contract.id, manager: current_manager.email
end
redirect_to @contract, notice: '操作成功'
end
使用双引号在placeholder,需要进行外层的单引号进行调用内层的双引号
<td>
<%= text_area_tag :whitelist, '', placeholder: '仅支持钱包地址。例如:["0xDC351d1", "0x6De3fB4Ed1", "0x6De3fB1"] 出现3次,就表示 往 nft_owners 表中增加3条记录。]',
class: 'form-control', style: 'hight: 100px;!important' %>
</td>