views:

55

answers:

2

I am using aptana radrails empty rail project : scaffold Article titre:string body:text categorie_id:integer ordre:integer Migrate -> it works fine

scaffold Categorie titre:string ordre:integer

It generate the files but when i access http://127.0.0.1:3000/categories i have the following error :

NameError in Categories#index Showing app/views/categories/index.html.erb where line #22 raised:

undefined local variable or method `new_categorie_path' for #

Extracted source (around line #22):

19: 20:
21: 22: <%= link_to 'New categorie', new_categorie_path %>

i deleted recreated my whole rails project a few times, changed categorie with another name but it keep failling. Why ?

A: 

It should be

scaffold Category titre:string ordre:integer
Salil
A: 

Adding to Salil's answer which is correct, Rails convention is to have english like naming.

If you put

Categorie

in your scaffold Rails will not be able to pluralize it correctly in categories.

You can also try a different path using legacy names and no pluralization but it is a painful path.

I would advice to use english naming.

tommasop
that's it, i did not knew rails was so tied with english.Thanks!
Sylario