undefined method `people_path' for #<#:0x007f4be4bfbaa8>
Extracted source (around line #4):
<h1>Person#new</h1>
<p>Find me in app/views/person/new.html.erb</p>
<% form_for (@people) do |f|%>
<%= f.label :first_name%>
<%= f.text_field :first_name%>
<%= f.label :last_name%>
<%= f.text_field :last_name%>
<%= f.label :company%>
<%= f.text_field :company%>
<%= f.label :email%>
<%= f.text_field :email%>
<%= f.label :phone%>
<%= f.text_field :phone%>
<%end%>
---- Person Controller ----
def new
@people = Person.new
end
I have an error when I call person/new
----routes-----
get "person/new"
get "person/index"
get "person/show"
get "person/delete"
get "person/update"
get "person/create"
resources :person
----migrate----
class CreatePeople < ActiveRecord::Migration
def change
create_table :people do |t|
t.string :first_name
t.string :last_name
t.string :company
t.string :email
t.string :phone
t.timestamps
end
end
end
--model--
class Person < ActiveRecord::Base
end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…