Rails3 encountered an undefined method `*_path’ error when using form_for.

  question, ruby

Userails g controller admin::articles index new editTo create a controller, userails g model articleThe model created. Route is

namespace :admin do
 resources :articles
 end

/app/controllers/admin/articles_controller.rb

class Admin::ArticlesController < ApplicationController
 def index
 @articles = Article.all
 end
 
 def new
 @article = Article.new
 end
 
 def edit
 @article = Article.find(params[:id])
 end

/app/models/article.rb

class Article < ActiveRecord::Base
 attr_accessible :content, :tag, :title
 end

Now you want to create a form using form_for in new.html.erb

<%= form_for(@article) do |f| %>
 <div class="field">
 <%= f.label :title %><br />
 <%= f.text_field :title %>
 </div>
 <% end %>

As a result, an error occurred only when testing here. Please help us to see what went wrong.