/ / Simple_form & Twitter बूटस्ट्रैप: उत्पादन में HTML गायब, फॉर्म लेबल अनलग्ड? - रूबी-ऑन-रेल, रूबी, रूबी-ऑन-रेल्स -३, रूबी-ऑन-रेल्स -३, सरल-रूप

Simple_form और ट्विटर बूटस्ट्रैप: प्रपत्र लेबल unaligned, उत्पादन में एचटीएमएल गायब? - रूबी-ऑन-रेल, रूबी, रूबी-ऑन-रेल-3, रूबी-ऑन-रेल-3.1, सरल-रूप

जब मैं उत्पादन में जाता हूं, तो मेरे रूप बदल जाते हैं, जिससे लेबल और क्षेत्र एक-दूसरे से असंबद्ध हो जाते हैं। विकास में यह सही ढंग से काम करता है लेकिन उत्पादन में नहीं।

यही है जो मेरा मतलब है:

Development
<div class="control-group string required">
<div class="control-label">
<label for="store_business_name" class="string required">
<abbr title="required">
*
</abbr> Business
</label>
</div>
<div class="controls">
<input type="text" size="50" name="store[business_name]" id="store_business_name" class="string required span3">
<p class="help-block">
The Business the store will belong to
</p>
</div>
</div>

Production
<div class="control-group string required">
<label for="store_business_name" class="string required">
<abbr title="required">
*
</abbr> Business
</label>
<div class="controls">
<input type="text" size="50" name="store[business_name]" id="store_business_name" class="string required span3">
<p class="help-block">
The Business the store will belong to
</p>
</div>
</div>

यदि आप बारीकी से देखते हैं, <div class="control-label"> उत्पादन में गायब हो जाता है। मैं किसी भी प्रकार के बूटस्ट्रैप मणि का उपयोग नहीं कर रहा हूं (रत्नों पर निर्भर मैं "टी स्थापित कर सकता हूं")। क्या यह एक ज्ञात मुद्दा है, यह कैसे तय किया गया है?


<%= simple_form_for(@store, :html => { :class => "form-horizontal" }) do |f| %>
<%= render :partial => "shared/error_message", :locals => { :f => f } %>
<div class="span12">
<%= f.input :business_name, :label => "Business", :input_html => { :class => "span3" }, :hint => "The Business the store will belong to" %>
<%= f.input :online_store, :label => "Online Store", :as => :boolean %>
<%= f.input :address, :input_html => { :class => "span3" }, :placeholder => "451 University Avenue, Palo Alto, CA 94301", :hint => "For offline store" %>
<%= f.input :website, :input_html => { :class => "span3" }, :placeholder => "www.somewebsite.com", :hint => "For online store" %>
<%= f.input :phone_number, :input_html => { :class => "span3" }, :placeholder => "(650) 798-2800" %>
<div class="form-actions">
<%= f.button :submit, "Done", :class => "btn btn-primary span2" %>
</div>
</div>
<% end %>

उत्तर:

उत्तर № 1 के लिए 1

Simple_form के किस संस्करण का आप उपयोग कर रहे हैं? आपने बूटस्ट्रैप को कैसे एकीकृत किया?

मान लें कि आपने ट्विटर / बूटस्ट्रैप के साथ एकीकृत करने के लिए simple_form का उपयोग किया है तो कृपया सत्यापित करें:

  1. lib / simple_form / निहित_input_component.rb लोड किया जा रहा है और इसे इस प्रकार लागू किया जा रहा है
  2. config / initializers / simple_form.rb उपरोक्त लाइब्रेरी को कॉल कर रहा है
  3. config / initializers और config / उत्पादन में केवल एक simple_form.rb है

यदि उपरोक्त सभी क्रम में हैं, तो कृपया अपने दृश्य कोड के साथ प्रश्न को अपडेट करें।