첫 번째 속성 집합 만 나타나지만 양식 내에 여러 개의 중첩 된 특성을 사용하려고합니다. 다음은 ruby on rails 프로젝트 내에서 여러 개의 중첩 된 양식
는 가.mdl-cell.mdl-cell--10-col.mdl-cell--1-offset
%h3.mdl-typography--display-1= t('.account_title')
= form.fields_for :address do |address_fields|
.mdl-grid
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= address_fields.text_field :first_name, class: 'mdl-textfield__input'
= address_fields.label :first_name, class: 'mdl-textfield__label'
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= address_fields.text_field :last_name, class: 'mdl-textfield__input'
= address_fields.label :last_name, class: 'mdl-textfield__label'
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= form.text_field :name, class: 'mdl-textfield__input'
= form.label :name, class: 'mdl-textfield__label'
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= form.email_field :email, class: 'mdl-textfield__input'
= form.label :email, class: 'mdl-textfield__label'
%h3.mdl-typography--display-1= t('.bank_title')
= form.fields_for :account do |account_fields|
.mdl-grid
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= account_fields.text_field :bsb, class: 'mdl-textfield__input'
= account_fields.label :bsb, class: 'mdl-textfield__label'
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--6-col
= account_fields.text_field :account_number, class: 'mdl-textfield__input'
= account_fields.label :account_number, class: 'mdl-textfield__label'
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.mdl-cell.mdl-cell--12-col
= account_fields.text_field :account_name, class: 'mdl-textfield__input'
= account_fields.label :account_name, class: 'mdl-textfield__label'
정의가 모델이이 새로운 형태 (형태 각 추가 속성을 구축 할 필요가 부모에
accepts_nested_attributes_for :address, reject_if: proc { |attributes| attributes['address1'].blank? }
accepts_nested_attributes_for :trading_hours
accepts_nested_attributes_for :phones, :reject_if => lambda { |t| (t['display_number'].gsub(/\D+/, '').blank?) }
accepts_nested_attributes_for :account
레일스 서버 로그에서 전달되는 매개 변수를 표시 할 수 있습니까? – Kumar