0

私が生産に入ると、フォームが変わり、ラベルとフィールドが互いにアライメントされなくなります。開発中は正しく動作しますが、実稼働環境では動作しません。よく見ると、<div class="control-label">は生産に消えSimple_form&Twitter Bootstrap:フォームラベルが整列していないか、本番環境でHTMLが抜けていますか?

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> 

:ここ

は、私が何を意味するかです。私はブートストラップの宝石を使用していません(インストールできない宝石に依存しています)。これは既知の問題ですか?これはどのように修正されていますか?


<%= 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 %> 
+0

この出力を生成するビューを通過できますか? envのコードが同じであることを確認してください。 – shingara

答えて

1

あなたが使用しているSimple_formのバージョンは何?どのようにブートストラップを統合しましたか?

  • 設定/初期化子/ simple_formあるとして、

    1. のlib/simple_form/contained_input_component.rbがロードされており、実装されています

      は、あなたがして確認してくださいさえずり/ブートストラップと統合するsimple_formのWikiを使用想定します。 RBは、上記のすべてが中である場合、または設定/初期化子とのconfig /生産で唯一のsimple_form.rb

    がある

  • 上記のライブラリを呼び出していますあなたのビューコードで質問を更新してください。

  • +0

    これは宝石の問題でした。私は2.0.0.rc.を使用していました私は2.0.1にアップグレードし、今はすべてが良いです。ご心配いただきありがとうございます。 – LearningRoR

    +1

    @Railslearner:サイドノートで心配する必要はありません。新しい宝石を統合し、Gemファイルに宝石のバージョンを明示的に定義するときは、常に最後の安定版をチェックしてください。出血のエッジは家庭実験、秘密の実験室、バグテスターのためのものです:P –

    関連する問題