简体   繁体   English

Ruby on Rails:twitter-bootstrap-rails生成一个控制器

[英]Ruby on Rails : twitter-bootstrap-rails generate a controller

Hi in my rails app im using the twitter-bootstrap framework. 嗨,在我的rails应用程序im中,我使用的是twitter-bootstrap框架。 I've generate a controller 我已经生成了一个控制器

rails g controller controller_name action1 action2

how i can add bootstrap to the views? 我如何向视图添加引导程序?

Can i use a generator? 我可以使用发电机吗?

Assuming you installed gem 'twitter-bootstrap-rails' gem. 假设您安装了gem 'twitter-bootstrap-rails' rails'gem。

You just need to run generator rails generate bootstrap:install static that will install all related files into your application. 您只需要运行generator rails generate bootstrap:install static ,它将所有相关文件安装到您的应用程序中。

Once you done with this, you can generate your layout and theme, like an example rails g bootstrap:themed Posts 完成此操作后,您可以生成布局和主题,例如示例rails g bootstrap:themed Posts

You can find more details from twitter-bootstrap-rails 您可以从twitter-bootstrap-rails中找到更多详细信息

You can view video tutorial from railscasts Twitter Bootstrap Basics 您可以从railscasts Twitter Bootstrap Basics观看视频教程。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM