ฉันได้รับข้อผิดพลาดจากรางที่บ่นเกี่ยวกับเส้นทาง
นี่คือลิงค์
link_to 'Add New Rate', new_owner_property_rate_path
ข้อผิดพลาด
No route matches {:action=>"new", :controller=>"owner/rates"}
เส้นทางดูสวยงามราวกับเสาะหาเส้นทางที่ได้มาเส้นเส้นทางนี้
new_owner_property_rate GET /owner/properties/:property_id/rates/new(.:format) {:action=>"new", :controller=>"owner/rates"}
นี่คือไฟล์เส้นทางของฉัน ซึ่งนั่งอยู่ในโฟลเดอร์ชื่อเจ้าของ ดังนั้นเนมสเปซ
namespace :owner do
resources :properties do
resources :rates
end
root :to => "home#index"
end
ผู้ควบคุมอัตรา
class Owner::RatesController < Owner::BaseController
def index
@rates = Rate.all
end
def new
@property = Property.find(params[:property_id])
@rate = Rate.new
end
end
ฉันสามารถเข้าสู่เส้นทางด้วยตนเองได้หรือไม่?
ความคิดใด ๆ