简体   繁体   English

rails使用bootstrap-sass而不是twitter-bootstrap-rails生成bootstrap布局

[英]rails generate bootstrap layout with bootstrap-sass instead of twitter-bootstrap-rails

I had to choose from bootstrap-sass and twitter-bootstrap-rails and I've opted for the first as per suggestions on the web. 我不得不从bootstrap-sasstwitter-bootstrap-rails选择,我根据网络上的建议选择了第一个。

However, I see that twitter-bootstrap-rails gem has some generators for application layout. 但是,我看到twitter-bootstrap-rails gem有一些用于应用程序布局的生成器。 Like, 喜欢,

rails g bootstrap:layout application fixed
rails g bootstrap:themed Posts

Which I find very good for kick-starting a project. 我认为这对于启动项目非常有用。 But I don't find similar generators available in the bootstrap-sass gem. 但是我没有在bootstrap-sass gem中找到类似的生成器。 Running the command: 运行命令:

rails generate 

doesn't show any generators like the previous ones. 没有像以前那样显示任何生成器。

Is there any way to have those layout using bootstrap-sass instead of using twitter-bootstrap-rails ? 有没有办法让这些布局使用bootstrap-sass而不是使用twitter-bootstrap-rails

Thanks in advance. 提前致谢。

There you can find a good way to generate theme for bootstrap-sass: 在那里你可以找到一个为bootstrap-sass生成主题的好方法:

https://github.com/doabit/bootstrap-sass-extras https://github.com/doabit/bootstrap-sass-extras

Basically you just: 基本上你只是:

 rails g scaffold Post title:string description:text
 rake db:migrate
 rails g bootstrap:themed Posts

I am using this gem, although I am unaware of generators for it. 我正在使用这个宝石,虽然我不知道它的生成器。

I found a gem on GitHub which you might find useful: 我在GitHub上找到了一个你可能会觉得有用的宝石:

https://github.com/decioferreira/bootstrap-generators https://github.com/decioferreira/bootstrap-generators

Alternatiely, you may simply define a new custom.css.scss file and start playing with the css of the whole app. 或者,您可以简单地定义一个新的custom.css.scss文件并开始使用整个应用程序的CSS。 And don't forget to add the bootstrap imports to your files! 并且不要忘记将bootstrap导入添加到您的文件中!

There are also these (lesser known but probably worth a try) gems: 还有这些(鲜为人知,但可能值得一试)宝石:

https://github.com/thrivesmart/bootscaf https://github.com/thrivesmart/bootscaf

https://github.com/leandroo/flexi_generators https://github.com/leandroo/flexi_generators

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

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