我正在渲染一个类似于下面的表单:
= render partial: "shared/address", locals: {f: property_address, prop_hint: 'some hint'}
部分是:
= f.input :address_1, label: "Street address", hint: prop_hint
= f.input :address_2, label: "Apt / Suite"
= f.input :city, input_html: {class: 'cf half-width-field'}
= f.input :state, input_html: {class: 'cf eighth-width-field'}
= f.input :zip_code, input_html: {class: 'cf three-eighth-width-field last'}
问题在于,当我将2个变量传递给本地哈希时,它无法识别第二个变量。我将问题追溯到这样一个事实,即部分渲染5次,每次输入一次,但我不知道为什么。