중첩 모델 (:admin accepts_nested_attributes_for :account_setting
)의 확인란이 몇 개 있습니다. 기본적으로 확인란의 레이블은 모델의 속성에서 생성됩니다. 하지만 로캘 폴더에 저장하는 사용자 지정 레이블을 키 값 쌍으로 사용하고 싶습니다. Formtastic을 사용하여 사용자 정의 레이블을 확인란에 지정
이
은
= semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :validate => true, :html => { :method => :put }) do |f|
= f.input :email
= f.inputs :receive_email_digest, :as =>:check_boxes, :for => :account_setting, :label => 'My custom label'
코드입니다 그리고 그것은 작동하지 않습니다. 나는 :input_html, :member_label
을 시도했다.
formtastic suppor this this? 아니면 해킹해야합니까?
두 번째 솔루션이 작동했습니다. 고맙습니다. – Rahul