इस चेक आउट:
आवरण एपीआई अच्छी तरह से अभी तक दर्ज नहीं किया है, लेकिन मैं इसे पता लगाने की कोशिश कुछ समय बिताया है। यहां एक साधारण उदाहरण है, जिसे सरल_फॉर्म प्रारंभकर्ता के अंदर सेट किया जा सकता है।
<%= 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
तब, जब आप एक फ़ॉर्म बनाते सिर्फ आवरण आप उपयोग करना चाहते निर्दिष्ट करें।
वह था! मुझे नहीं पता था कि आप इनपुट टैग की स्थिति को नियंत्रित करने के लिए "उपयोग: इनपुट" को स्पष्ट रूप से परिभाषित कर सकते हैं। यह डॉक्टर में लिखा जाना चाहिए। महान! –