如何配置 Rails 使用 blueprint-css 而不是默认的脚手架 css?

发布于 2024-07-25 19:42:11 字数 77 浏览 3 评论 0原文

您需要对 Rails 项目进行哪些更改才能将 blueprintcss 配置为生成脚手架而不是scaffold.css 时使用的默认样式表?

What changes do you need to make to a Rails project to configure blueprintcss as the default stylesheet to be used when you generate scaffolding instead of scaffold.css?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱的故事 2024-08-01 19:42:11

我建议编写您自己的生成器,但如果您想更改默认值,您可以:

1 - 对于单个应用程序:冻结 Rails 并更改脚手架生成器使用的样式表。

railsapp/vendor/rails/railties/lib/rails_generators/generators/components/scaffold/templates/style.css

2 - 对于所有应用程序:在系统 Rails 安装中更改相同的 style.css 文件。

I'd recommend writing your own generator, but if you want to alter the default you can:

1 - For a single app: Freeze rails and change the stylesheet the scaffold generator uses.

railsapp/vendor/rails/railties/lib/rails_generators/generators/components/scaffold/templates/style.css

2 - For all apps: Change the same style.css file in your systems rails installation.

末蓝 2024-08-01 19:42:11

替换您自己的脚手架生成代码。 说明位于此处(请注意它们可能已经过时)。

一个更简单的替代方案可能是编写一个 Rake 操作来在(通常)生成的源中进行文本替换。

Substitute your own scaffolding generation code. Instructions are here (with the caveat that they may be out of date).

An easier alternative may be to write a Rake action to do textual substitution in the (normally) generated source.

倚栏听风 2024-08-01 19:42:11

查看 Rails 模板。

您可以编写一个代码来做更多的事情,而不仅仅是替换 Rails 应用程序中的 CSS。 你可以让它安装宝石、冻结轨道以及各种东西。 请访问 http://youvegotrails.com 了解您可以做什么。

Look into Rails Templates.

You can write one to do much more than replace the css in a rails app. YOu can make it install gems, freeze rails, all kinds of things. Take a look at http://youvegotrails.com for an idea of what you can do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文