확인이 아웃 :
래퍼 API는 아직 잘 문서화되어 있지 않습니다,하지만 난 그것을 알아 내려고 시간을 보냈어요. 다음은 simple_form 이니셜 라이저 안에서 설정할 수있는 간단한 예제입니다. 이 도움이
<%= simple_form_for @user, wrapper: 'WHATEVER_YOU_CALLED_YOUR_WRAPPER' do |form| %>
<%end%>
희망 : 폼을 만들 때
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a complete input.
# You can remove any component from the wrapper, change the order or even
# add your own to the stack. The options given to the wrappers method
# are used to wrap the whole input (if any exists).
config.wrappers :GIVE_YOUR_WRAPPER_A_NAME, :class => 'clearfix', :error_class => nil do |b|
b.use :placeholder
b.use :label
b.use :tag => 'div', :class => 'WHATEVER_YOU_WANT_TO_CALL_IT' do |ba|
ba.use :input
ba.use :error, :tag => :span, :class => :'help-inline'
ba.use :hint, :tag => :span, :class => :'help-block'
end
end
end
그런 다음, 당신이 사용하고자하는 래퍼를 지정합니다.
그 것이었다! 나는 당신이 명시 적으로 "use : input"을 정의하여 입력 태그의 위치를 제어 할 수 있다는 것을 몰랐다. 이것은 문서에 기록되어야합니다. 큰! –