problem with submit button in rails 3

hi,

      i am using <%= s.submit 'Product save' %>
when i click it, following error appears

   " Routing Error

    uninitialized constant ProductsController"

could any one provide me solution ?

thanks,
-pab

Do you have a controller named ProductsController?

hi
   well i am have having contoller named ProductController
but its asking for ProductsController
i don't know how to over come this problem?

thanks,
-pab

hi

well i am have having contoller named ProductController

but its asking for ProductsController

i don’t know how to over come this problem?

Hi,

rename your controller from ProductController to ProductsController. In Rails, the convention is the plural in controller’s name.

Best Regards,

Everaldo

It’s Rails convention that controllers should use the plural name of the model, like ProductsController

You could probably make it work by using the singular name of the model, but it would go against convention and wouldn’t be very easy to maintain.

and of course the file should be products_controller.rb and the model
should be Product in products.rb and the table name products.

Colin