never_had_a_name
never_had_a_name

Reputation: 93196

ruby-on-rails 3 resource handling

Here is my case:

I have 3 menus (vietnamese, chinese, japanese) that each contains 10 dishes.

I wonder how should i route these to produce one page per menu with its dishes.

So that I in the view can have 3 links in the frontpage view, one for each menu.

Right now it looks like this:

resources :menus

But then the index view would show ALL menus with all dishes.

I find RESTful very hard to understand in rails.

Would be glad for any help!

Upvotes: 0

Views: 45

Answers (1)

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

So /menus (index) will just show the list of all menus.

Then

  • /menus/1 could show Vietnamese
  • /menus/2 could show Chinese
  • /menus/3 could show Japanese

the /menus/id is the show action

Upvotes: 2

Related Questions