我做了如下介紹: http://guides.rubyonrails.org/getting_started.html沒有路線匹配[POST]「/ articles/new」 - 爲什麼?
在這之後,我想創造一個新的領域(如標題),並得到了錯誤的通知:
這裏是我的代碼:
路線.RB
Rails.application.routes.draw do
get 'welcome/index'
resources :articles do
resources :comments
resources :description
root 'welcome#index'
# For details on the DSL available within this file, see guides.rubyonrails.org/routing.html
end
end
我知道這個問題已經被問了很多,但他們的解決方案並沒有幫助我。
我該怎麼辦?
問候
顯示你的'config/routes.rb'文件。 – yzalavin
您需要添加更多詳細信息才能讓人們獲得幫助。例如,一切正常工作,直到您開始進行更改以添加新字段?如果是這樣,請描述您所做的更改。此外,何時出現此錯誤? – mikej
這裏是檔案
Rails.application.routes.draw do get 'welcome/index' resources :articles do resources :comments resources :description root 'welcome#index' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end end
而且我確實改變了new.html.erb文件。我添加了一個新的f.label和f.textarea – neverbesuccesfulllperson