Ruby-on-rails – undefined local variable or method `new_media_path’ – resources to resource

ruby-on-railsruby-on-rails-3ruby-on-rails-3.1

I have odd problem:

After starting server I got this error:

undefined local variable or method `new_media_path'

To repair this i must go to routes.rb and change

resources :media

to

resource :media

and again to

resources :media

It's annoying. Any ideas to solve this?

Best Solution

You should try new_medium_path because media is plural form of medium

If you run rake routes you will see all available routes.

Related Question