ブートストラップをバージョン3にアップデートしました。シンプルフォームgemで生成されたフォーム以外はすべて正常に動作します。私はこれら2つをどのように統合できるのか分かりません。私はgithubプロジェクトリポジトリにも有益な提案はありません。それで誰も私のための解決策を持っていますか?シンプルフォームとブートストラップ3の統合
答えて
http://stabco.tumblr.com/post/59760641051/simple-form-bootstrap3-integrationのブログ記事は良い解決策のようです。これは、この要旨は私にとって非常に有用だったブートストラップ3
設定/初期化子に初期化子を作成し、以下の内容を入力してブートストラップ固有のsimple_form設定を作成する必要があります。
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: 'div', class: 'controls' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
config.wrappers :prepend, tag: 'div', class: "control-group", error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
prepend.use :input
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
end
end
config.wrappers :append, tag: 'div', class: "control-group", error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-append' do |append|
append.use :input
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
end
end
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
# Check the Bootstrap docs (http://twitter.github.com/bootstrap)
# to learn about the different styles for forms and inputs,
# buttons and other elements.
config.default_wrapper = :bootstrap
end
単純な形式3.1.0.rc1がリリースされました。これは、統合の問題を解決するはずです。 http://blog.plataformatec.com.br/2014/04/bootstrap-3-support-for-simple-form/のブログ記事をご覧ください。または最新のシンプルフォームfor Bootstrapをご覧ください:http://simple-form-bootstrap.plataformatec.com.br/
単純なフォームをこのバージョンに更新すると、良いものになるはずです。
2014年4月現在、Bootstrap 3 integration is more fully supportedとして、新しいリリースで追加のラッパーが提供されています。
我々はそれを可能にするために3 をブートストラップするためのサポートと簡単なフォーム3.1.0.rc1をリリースし、我々は それをより拡張性にするために、開発者が直接それを代わりに設定できるようにするラッパーAPIをレベルアップグローバルな状態に頼っている。 は、そのような改良した後、あなたがここでの例アプリを通じてアクションの新機能を見ることができますブートストラップ3と 仕事に
を簡単なフォームの設定を変更することは非常に簡単でした:http://simple-form-bootstrap.plataformatec.com.br/
- 1. Webpack:ブートストラップ3と角度2のアプリケーションの統合
- 2. Thymeleaf 3とTiles2の統合
- 3. SFTPとスプリング3の統合
- 4. CakePHPとExtJS 3の統合
- 5. PaypalとPhalcon 3の統合
- 6. easyUIとのTwitterブートストラップの統合
- 7. ブートストラップ管理ページとLaravel 5.4の統合
- 8. フリースをブートストラップと統合する4カルーセル
- 9. サスとブートストラップを統合するには?
- 10. FacebookのログインとParse Swiftの統合3
- 11. 私のionic 3アプリケーションとfreshchatの統合
- 12. Rails 3 - Active_adminとCanCanの統合
- 13. Paypal PHP sdkとCakephp 3.xの統合
- 14. Spring 2.5とIbatis 3の統合
- 15. MVC 3 Facebookとの統合エラー
- 16. PHPのウェブサイトへのブートストラップの統合
- 17. Pythonの3統合エラー
- 18. symfony 3のテーマ統合
- 19. Grailsでのブートストラップの統合2.0.1
- 20. ブートストラップ3とブートストラップ4のフォントレンダリング
- 21. Springセキュリティ3認証とHibernate 3(JPA)アノテーションとの統合
- 22. 既存のWebアプリケーションにブートストラップを統合
- 23. WSO2アイデンティティサーバーとスプリング3 REST API統合
- 24. GoogleマップとOpenLayersを3統合例
- 25. 迅速なVoip統合3
- 26. ブートストラップを.liquidに統合する(shopify)
- 27. ブートストラップを3つの先読みとタグをオブジェクトとタグとして統合する
- 28. シンプルフォームのブートストラップは、collection_radio_buttonsフィールドをカスタマイズします
- 29. symfony3とブートストラップを統合する最良の方法
- 30. ブートストラップ要素をCSSテンプレートと統合する際の問題
ブートストラップだ2 – Edward