我剛開始的Ruby on Rails的教程由邁克爾·哈特爾的第5課:在佈局灌裝加入一些結構未能渲染回報率哈特爾教程變化
我的變化,雖然都沒有被下旬以來第3課渲染。當我在任何頁面(home.html.erb,about.html.erb等)中進行更改時,我都沒有問題。但是登錄和標題等內容不會改變。
application.html.erb
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<%= link_to "sample app", '#', id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>
<section>
<%= yield %>
</section>
</body>
</html>
的routes.rb
SampleApp::Application.routes.draw do
get "pages/home"
get "pages/contact"
get "pages/about"
end
home.html.erb
<h1>Sample App</h1>
<p>This is the home page for the <a href="http://railstutorial.org">Ruby on Rails Tutorial</a> sample application.</p>
再次,我頁面在第三章中沒有使用樣式表,不更改導航欄,而是使用不正確的標題(localhost:3000/pages/home)來代替Ruby on Rails示例應用程序。
不幸的是,也沒有工作。你知道這是爲什麼嗎? –
摺疊導航欄,您是否使用twitter bootstrap 3 ?,請轉到:getbootstrap.com檢出該站點中的組件部分。你會發現很多模板和代碼的東西。更好地使用和改變,而不是物理地寫一切 –