我需要帮助在 Rails 中集成 wrap Bootstrap 主题。如果它不要求太多,一步一步更深入会很棒。我总觉得留下了一些小细节。
我购买了http://wrapbootstrap.com/preview/WB02634G3并且无法让某些样式/JavaScript 正常工作。
- 我已将所有文件添加到相应的资产文件夹中,并尝试在 application.js/application.css 文件中要求每个文件名。就像下面这个例子。
//= 需要主题
- 对于图像,我已将它们重命名为“/assets/showcase1.png”。在某些情况下,我发现这种格式也适用“../images/showcase.png”
这是我的 application.html.erb 文件的样子。
<!DOCTYPE html>
<html>
<head>
<title>DPL</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%=s tylesheet_link_tag "application", :media=>"all" %>
<%=j avascript_include_tag "application" %>
<%=c srf_meta_tags %>
<!-- Styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" href="css/index.css" type="text/css" media="screen" />
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/lib/animate.css" media="screen, projection">
</head>
<body>
<body class="pull_top">
<div class="navbar transparent navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="index.html">
<strong>DPL</strong>
</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li><a href="index.html" class="active">HOME</a></li>
<li><a href="about-us.html">ABOUT US</a></li>
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
PAGES
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="features.html">Features</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="portfolio-item.html">Portfolio Item</a></li>
<li><a href="coming-soon.html">Coming Soon</a></li>
<li><a href="sign-in.html">Sign in</a></li>
<li><a href="sign-up.html">Sign up</a></li>
<li><a href="backgrounds.html">Backgrounds</a></li>
</ul>
</li>
<li><a href="pricing.html">PRICING</a></li>
<li><a href="contact.html">CONTACT US</a></li>
<li><a href="blog.html">BLOG</a></li>
<li><a class="btn-header" href="sign-up.html">Sign up</a></li>
<li><a class="btn-header" href="sign-in.html">Sign in</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<%=y ield %>
</div>
</body>
</html>
我已将这些添加到我的 gem 文件中。
gem 'libv8'
gem 'twitter-bootstrap-rails'
gem 'bootswatch-rails'