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

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.

On 21 September 2011 16:35, Everaldo G. [email protected]
wrote:

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

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

gplus.to/clanlaw

On Wed, Sep 21, 2011 at 12:29 PM, Pab [email protected] wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs