0
我正在使用Michael Hartl教程。在第7章中我發現的問題,我顯示當我啓動服務器並運行Rails教程,第7章未定義的方法「model_name」
http://localhost:3000/signup
我recive此消息:
NoMethodError in User#new
Showing C:/rails_project/sample_app/app/views/user/new.html.erb where line #6 raised:
undefined method `model_name' for NilClass:Class
Extracted source (around line #6):
3:
4: <div class="row">
5: <div class="span6 offset3">
6: <%= form_for(@user) do |f| %>
7:
8: <%= f.label :name %>
9: <%= f.text_field :name %>
Rails.root: C:/rails_project/sample_app
Application Trace | Framework Trace | Full Trace
app/views/user/new.html.erb:6:in `_app_views_user_new_html_erb___578921578_24443340'
有任何想法?
這是正確定義的變量這種類型的錯誤來。謝謝! – szatan