如何在我的Rails 3.2.1应用程序中使用twitter-bootstrap-rails gem?工作流程是什么?
在我这样做之后:
rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]我下一步该怎么做?我只是将生成的代码复制并粘贴到我的视图中吗?我对每个视图都要这样做吗?如果是这样的话,你觉得怎么样?
rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]有什么不同吗?
你们用过rails生成器吗?
谢谢
发布于 2012-03-16 21:50:15
有一个RailsCasts教程是一个很好的起点:
http://railscasts.com/episodes/328-twitter-bootstrap-basics
发布于 2012-02-03 16:05:35
我是twitter-bootstrap-rails gem的作者。我将带您快速了解如何安装和使用twitter-bootstrap-rails。
Ruby堆栈;(需要Ruby 1.9.3、Rails 3.1或Rails 3.2。使用RVM入门)
将gem捆绑到Gemfile后;
gem 'twitter-bootstrap-rails'
bundle install运行安装生成器
rails g bootstrap:install(它将包括Twitter Bootstrap到您的应用程序的资产管道)
运行布局生成器
rails g bootstrap:layout application fixed(将为您生成布局,默认为application.html.erb,固定布局将生成)
运行主题生成器(可选);
rails g scaffold post title:string description:text(此步骤使用Rails生成器为您创建CRUD内容)
rake db:migrate(迁移到数据库)
rails g bootstrap:themed posts(与Twitter Bootstrap兼容的样式,适用于您的“帖子”视图和表单)
此外,还有详细的文档来安装,使用和生成器,咖啡脚本等https://github.com/seyhunak/twitter-bootstrap-rails。
发布于 2012-11-04 09:06:14
运行:
rails new APPLICATION -m anyfile.rbanyfile.rb
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
generate("scaffold", "Post title:string content:text")
rake("db:create")
rake("db:migrate")
generate("bootstrap:layout", "application fluid")
generate("bootstrap:install")
generate("bootstrap:themed", "posts")
git :init
git :add => "."
git :commit => "-m First commit!"https://stackoverflow.com/questions/9118923
复制相似问题