I m new to rails. 我有我的控制者和看法。
When I view my html source, my body is empty. I put a debugger in my controller and my view and it hits both so I know it s being executed. Any idea what I m doing wrong? I have also installed bootstrap.
Thank you in advance. see below.
class ListController < ApplicationController
def recent
@page_title = @head_title="Lists"
end
end
近期.html
<ul class="tabs">
<li class="active"><a href="#">Lorem</a></li>
<li><a href="#">Ipsum</a></li>
<li><a href="#">Dolor</a></li>
<li><a href="#">Sit</a></li>
<li><a href="#">Amet</a></li>
</ul>
申请:html.erb
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : "Myapp" %></title>
<meta name="description" content="">
<meta name="author" content="">
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= yield(:head) %>
</head>
</html>
html 源代码
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Myapp</title>
<meta name="description" content="">
<meta name="author" content="">
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/custom.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/home.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/alert.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/button.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/carousel.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/collapse.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/modal.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/tooltip.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/popover.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/scrollspy.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/tab.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/transition.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap/typeahead.js?body=1" type="text/javascript"></script>
<script src="/assets/twitter/bootstrap.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-transition.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-alert.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-button.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-carousel.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-collapse.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-modal.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-scrollspy.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tab.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tooltip.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-typeahead.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="7imEFVfD5bYIV7ZcK4181eCoz0pKxyyE2G+UFI46v5U=" name="csrf-token" />
</head>
</html>
从服务器记录中提取
Started GET "/list/recent" for 127.0.0.1 at Fri May 18 17:54:57 -0700 2012 Processing by ListController#recent as HTML Rendered list/近期.html within layouts/application (0.8ms) Completed 200 OK in 17ms (Views: 16.9ms | ActiveRecord: 0.0ms)