Ruby on Rails Thursday, February 5, 2015

On 2015-Feb-5, at 13:49 , Greg Bressler <lists@ruby-forum.com> wrote:

> I was working my way through Rails Guides getting started tutorial
> (http://guides.rubyonrails.org/getting_started.html). Everything was
> going well until the end of 5.2 when I was set to make a blog post. Any
> help that could be provided would be greatly appreciated.
>
>
> Here's the trace:
>
> No route matches [POST] "/articles/new"

Presumably, you have: new_article_path in your form_for, but you ought to have: articles_path

See the routes listing you have below that only has GET for the /articles/new path and the path which routes to articles#create is a POST to /articles (same as the GET uses for articles#index)

-Rob

>
> Rails.root: /home/gregb/workspace/blog
>
>
> Application Trace | Framework Trace | Full Trace
> actionpack (4.1.8)
> lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
> actionpack (4.1.8)
> lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
> railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
> railties (4.1.8) lib/rails/rack/logger.rb:20:in `block in call'
> activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `block
> in tagged'
> activesupport (4.1.8) lib/active_support/tagged_logging.rb:26:in
> `tagged'
> activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in
> `tagged'
> railties (4.1.8) lib/rails/rack/logger.rb:20:in `call'
> actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in
> `call'
> rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
> rack (1.5.2) lib/rack/runtime.rb:17:in `call'
> activesupport (4.1.8)
> lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
> rack (1.5.2) lib/rack/lock.rb:17:in `call'
> actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
> rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
> railties (4.1.8) lib/rails/engine.rb:514:in `call'
> railties (4.1.8) lib/rails/application.rb:144:in `call'
> rack (1.5.2) lib/rack/lock.rb:17:in `call'
> rack (1.5.2) lib/rack/content_length.rb:14:in `call'
> rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
> /home/gregb/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:138:in
> `service'
> /home/gregb/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:94:in
> `run'
> /home/gregb/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in
> `block in start_thread'
> Routes
>
> Routes match in priority from top to bottom
>
> Helper HTTP Verb Path Controller#Action
> Path / Url
> welcome_index_path GET /welcome/index(.:format) welcome#index
> root_path GET / welcome#index
> articles_path GET /articles(.:format) articles#index
> POST /articles(.:format) articles#create
> new_article_path GET /articles/new(.:format) articles#new
> edit_article_path GET /articles/:id/edit(.:format) articles#edit
> article_path GET /articles/:id(.:format) articles#show
> PATCH /articles/:id(.:format) articles#update
> PUT /articles/:id(.:format) articles#update
> DELETE /articles/:id(.:format) articles#destroy
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/03e12fb45a457bb7b6898c1ea5f18a19%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58C0215C-064C-42A5-8E5B-1DF258991006%40agileconsultingllc.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment