Keď idem do výroby, moje formy sa zmenia, čo spôsobí, že štítky a polia nebudú navzájom zarovnané. Vo vývoji funguje správne, ale nie vo výrobe.
Tu mám na mysli:
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>
Ak sa pozriete pozorne, <div class="control-label">
zmizne vo výrobe. Nepoužívam žiadny typ bootstrap drahokamu (v závislosti od drahokamov, ktoré nemôžem nainštalovať). Je to známy problém, ako je opravený?
<%= 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 %>
odpovede:
1 pre odpoveď č. 1Akú verziu Simple_form používate? Ako ste integrovali bootstrap?
Za predpokladu, že ste na integráciu s twitter / bootstrap použili wiki simple_form ", potom prosím overte:
- lib / simple_form / contained_input_component.rb sa načítava a implementuje sa tak, ako je
- config / initializers / simple_form.rb volá vyššie uvedenú knižnicu
- v config / initializers a config / production je iba jeden simple_form.rb
Ak je všetko v poriadku, aktualizujte otázku svojím kódom zobrazenia.