0
我是一个新手,我正在通过Hartl慢慢地工作。刚刚开始在Ch5上。到了5.1并将新的样式代码添加到application.html.erb中,并且我在浏览器中收到了“Static_pages#home中的NoMethodError”。Michael Hartl教程v。3.2第5.1章用户中的NoMethodError#new Line 4
这里的终端读出:
Started GET "/static_pages/home" for 127.0.0.1 at 2012-05-31 14:02:03 +0100
Processing by StaticPagesController#home as HTML
Rendered static_pages/home.html.erb within layouts/application (0.0ms)
Completed 500 Internal Server Error in 6ms
ActionView::Template::Error (undefined method `full_title' for #<#<Class:0x007f865b6a0160>:0x007f865b5faad0>):
1: <!DOCTYPE html>
2: <html>
3: <head>
4: <title><%= full_title(yield(:title)) %></title>
5: <%= stylesheet_link_tag "application", media: "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb__2520617125150382104_70107517560200'
Rendered /Users/Lagaspi/.rvm/gems/[email protected]/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.6ms)
Rendered /Users/Lagaspi/.rvm/gems/[email protected]/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms)
Rendered /Users/Lagaspi/.rvm/gems/[email protected]/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (9.1ms)
的static_pages_controller
class StaticPagesController < ApplicationController
def home
end
def help
end
def about
end
def contact
end
end
什么都没有成功完成Ch.3改变。所以我回去了,再次工作了第3章,所有的测试通过都是绿色的,所有的浏览器测试都OK,我跳回了第5章。将Hartls新代码剪切并粘贴到views/layouts/application.html.erb中,保存该文件并获得相同的No Method Error。
谢谢,一定错过了那一步!它的工作现在。 –
然后你应该接受答案 – Askar