2015-06-28 22 views
0

我在5.2節「第一種形式」流rails getting_started軌開始創建表單鏈接錯誤

,該

http://localhost:3000/articles/new

success form

正常工作之前,我添加表單「,網址:創建「我怎樣才能解決這個問題?

當我加url的結果是:

enter image description here

和軌道運行環境:

➜博客​​斌/耙路線

Prefix Verb URI Pattern     Controller#Action 

welcome_index GET /welcome/index(.:format)歡迎# index

 root GET /       welcome#index 

articles GET /articles(.:format)   articles#index 

      POST /articles(.:format)   articles#create 

new_article GET /articles/new(.:format)的文章#新

edit_article GET /articles/:id/edit(.:format)的文章#編輯

article GET /articles/:id(.:format)  articles#show 

      PATCH /articles/:id(.:format)  articles#update 

      PUT /articles/:id(.:format)  articles#update 

      DELETE /articles/:id(.:format)  articles#destroy 

➜博客​​紅寶石-v

紅寶石2.0.0p481(2014年5月8日修訂45883)[x86_64的-darwin13.1.0]

➜博客​​的sqlite3 --version

3.7.13 2012-07-17 17時46分21秒65035912 264e3acbced5a3e16793327f0a2f17bb

➜博客​​軌--version

的Rails 4.2.1

+0

是我的答案爲你工作? – Pavan

回答

1

應該

<%= form_for :article, url: articles_path do |f| %> 

<%= form_for :article, url: create do |f| %> 

欲瞭解更多信息,請查看本form_for

0

如果你只是腳手架,你的回答應該更簡單:

<%= form_for @article do |f| %> 

表單應現在的工作......