When I generated a scaffold for a model class named menuitem, it generates a class file for menuitem, but in the database creates menu_item and refers to the class in the views and controller as menu_item. This may be causing me quite a headache as im genereating a newsted show link, but its failing telling me missing method. The rake routes tells me the show route should be menu_menu_item, but when i do:
<td><%= link_to 'Show', menu_menu_item(@menu) %></td>
it doesnt work.
Is that because of the funky two word class name?
You must have generated either
menu_itemormenuItemorMenuItem. It doesn’t know where one word stops and another starts unless you tell it.Also, for your
link_tos, you just need to append_path:Well, actually, that looks a little wrong to me. That looks like you’re trying to go to a single item, which I think will require you to specify both the menu and the item:
And to all the menu items in a menu: