简体   繁体   English

如何将Twitter Bootstrap与Ruby on Rails 3.2.12结合使用?

[英]How do I use Twitter Bootstrap with Ruby on Rails 3.2.12?

I'm switching from PHP to Ruby on Rails and I'm loving it, the only thing is I'm so used to Twitter Bootstrap for most of my designs and now I feel crippled without it, I followed some tutorials like adding bootstrap-sass and what not to my Gemfile , but I still appear to be missing important things like input-block-level I'm just curious if there is an updated version or a easier tutorial to follow? 我正在从PHP切换到Ruby on Rails,我很喜欢它,唯一的是,对于我的大多数设计来说,我都习惯于Twitter Bootstrap,但现在我却感到束手无策,我遵循了一些教程,例如添加bootstrap-sass和我的Gemfile ,但是我仍然似乎缺少重要的东西,例如input-block-level我只是想知道是否有更新的版本或更容易学习的教程? Thanks. 谢谢。

AFAIK, the easiest and most rails way to integrate the twitter bootstrap to rails is via AFAIK是将Twitter Bootstrap集成到Rails的最简单,最便捷的方法

twitter-bootstrap-rails gem, they have a pretty good documentation too. twitter-bootstrap-rails gem,它们也有一个很好的文档。

check these screen casts , and this (premium) to get an idea. 检查这些屏幕投射 ,并对此(高级)有所了解。

and welcome to Rails :) 欢迎来到Rails :)

要达到ERB的input-block-level ,请执行以下操作

"input-block-level" => "hello_world"

Same as you, I'm coming from PHP and love RoR ;) 和您一样,我来自PHP并且喜欢RoR;)

With bootstrap you need to import it in your manifest. 使用引导程序,您需要将其导入清单中。 Read a bit about the assets pipeline in RoR guide. 在RoR指南中阅读一些有关资产管道的信息。

To import bootstrap, create a file in your app/assets/stylesheets directory, with the name you want, but with the extension .css.scss, and place in it the following line: 要导入引导程序,请在app / assets / stylesheets目录中创建一个文件,其名称为您想要的名称,但扩展名为.css.scss,并在其中放置以下行:

@import "bootstrap";

Also if you need to use the javascript helpers from bootstrap, you need to add the following line in your app/assets/javascript/application.js file: 另外,如果您需要使用引导程序中的javascript帮助器,则需要在app / assets / javascript / application.js文件中添加以下行:

//= require bootstrap

Just download the bootstrap ( CSS, JS ) file and make the updation in that file at regular interval from his official site : Bootstrap 只需从其官方网站上定期下载bootstrap(CSS,JS)文件并对该文件进行更新: Bootstrap

For Bootstrap Tutorials : Click Here 对于Bootstrap教程: 单击此处

Or you can refer the sample code for reference, because sometimes we dnt get the way to implement such functionality like tooltip. 或者,您可以参考示例代码以供参考,因为有时我们无法获得实现诸如工具提示之类的功能的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有更少的Rails 3.2.12和Twitter引导程序:V8错误 - Rails 3.2.12 with less and Twitter Bootstrap: V8 Error 如何使用JQuery.noConflict()修复Rails 3.2.12中的JQuery和引导程序之间的冲突? - How to use JQuery.noConflict() to fix conflict between JQuery and bootstrap in rails 3.2.12? Ruby on Rails中的Twitter引导程序 - Twitter Bootstrap in Ruby on Rails 如何使用Twitter中的Bootstrap样式表和Rails中的现有样式表而不会搞乱一切? - How do I use the Bootstrap stylesheet from Twitter with my existing stylesheet in Rails without messing up everything? 如何在Ruby On Rails中将Twitter API Pull转换为数组? - How do I convert a Twitter API Pull into an Array in Ruby On Rails? 如何仅在一页上安装twitter bootstrap rails 4? - how do I install twitter bootstrap rails 4 on just one page? 如何使用Rails响应Twitter Bootstrap? - How do I make Twitter Bootstrap Responsive with Rails? 如何使用Twitter Bootstrap在Rails 3.2中实现切换丸? - How do I implement toggle pills in Rails 3.2 with Twitter Bootstrap? 如何使用twitter-bootstrap-rails gem禁用部分Twitter Bootstrap响应式设计? - How do I disable a portion of Twitter Bootstrap responsive design using twitter-bootstrap-rails gem? 如何在ruby / rails中使用YAML? - How do I use YAML in ruby/rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM