需要将 wrapbootstrap 主题集成到新 Rails 应用程序的说明 [英] Need instructions integrating a wrapbootstrap theme into a new rails app

查看:41
本文介绍了需要将 wrapbootstrap 主题集成到新 Rails 应用程序的说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在 wrapbootstrap 上购买了一个主题,并启动了一个新的 Rails 应用程序来试验它.该主题没有任何文档,而且我是 Rails 的新手,所以我可以使用一些帮助.这里的其他示例都不是很详细,网上似乎也没有关于此的博客文章.谢谢.

I just purchased a theme at wrapbootstrap and fired up a new Rails app to experiment with it. The theme came with no documentation and I am new to Rails, so I could use some help. None of the other examples here are very detailed and there do not seem to be blog posts about this online. Thanks.

这就是主题,如果有帮助的话 - 假设我正在运行 Rails 3,已经运行了rails new Experiment"并且此时没有安装 gem,甚至没有安装引导程序.希望从一开始就在 stackoverflow 上为其他人提供明确的说明.

This is the theme, if that helps- Presume that I am running Rails 3, have ran 'rails new experiment' and have installed no gems at this point, not even bootstrap at this point. Would love to have definitive instructions for others, from the beginning, here on stackoverflow.

推荐答案

我建议您执行以下操作:

I suggest you do the following:

  • 将所有 CSS 文件复制到 vendor/assets/stylesheets
  • 将所有 JavaScript 文件复制到 vendor/assets/javascripts
  • 复制所有图片到vendor/assets/images
  • app/assets/stylesheets/application.css 中为您希望包含在应用程序中的每个 CSS 文件创建一个条目.此处列出的所有文件都应自动包含到使用默认布局 app/views/layouts/application.html.erb 的所有页面中.
  • app/assets/javascripts/applications.js 下的 JavaScript 也是如此.
  • Create an entry in app/assets/stylesheets/application.css for each CSS file you wish to include in your application. All the files listed in there should be automatically included into all pages that use the default layout app/views/layouts/application.html.erb.
  • Same thing for JavaScripts under app/assets/javascripts/applications.js.

随意自定义您的主题,但将您自己的文件放在 app/assets/stylesheetsapp/assets/javascriptsapp/assets/images 下.这样它们就不会与您购买的主题混淆,而且您可以轻松删除更改,而不必担心损坏主题.

Feel free to customize your theme, but put your own files under app/assets/stylesheets, app/assets/javascripts and app/assets/images. That way they won't get mixed up with the theme you purchased and you can easily delete your changes without fear of mangling your theme.

现在您将不得不手动编辑所有样式表和 JavaScript 文件以查找图像引用.将所有路径更改为 /assets.像这样:

Now you're going to have to manually edit all your stylesheets and JavaScript files looking for the image references. Change all paths to /assets. Like so:

background-image: url(http://www.example.com/images/bck.png)

变成:

background-image: url('/assets/bck.png')

这篇关于需要将 wrapbootstrap 主题集成到新 Rails 应用程序的说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆