我的路线.rb
resources :users do
resources :requests , :only => [:new,:create,:destroy]
end
用户.rb
class User < ActiveRecord::Base
attr_accessor :password
attr_accessible :email, :firstname, :lastname, :state, :city, :password, :password_confirmation, :image
# mount_uploader :image, ImageUploader
has_many :requests
请求.rb
class Request < ActiveRecord::Base
attr_accessible :email, :status, :user_id
belongs_to :user
end
用户登录后,从 user.show 页面我传递了一个链接
<li><span> <%= link_to "Send Request" , new_user_request_path(@user) %> </li>
我的路径显示正确,但在 request.new 下未显示,并且出现以下错误。
路由错误
No route matches {:controller=>"users", :action=>"edit"}
我是rails新手,有谁能帮帮我。
谢谢