I am attempting to get rails routes paths via nested resources. I have looked under rails guides using link below:
http://guides.rubyonrails.org/routing.html#nested-resources
For instance,
resources :users do
resources :weekly_progress_charts
resources :calories_journals
end
i know and can use :users paths. What are the paths for calories_journals for instance?
for example, user_calories_journals_path does not get me a list of index via “users/1/calories_journals”
What is the correct rails’s RESTFUL paths for calories_journals via selected user:
new
edit
update
create
destroy
show
index
Thanks in advance
You can call
It will show the index view in
app/views/caleries_journals/index.erb.htmlORapp/views/caleries_journals/show.erb.htmlEricM is right, use
rake routesin the terminal to view all routes.Notice that you could have
resources :calories_journalalso and it would work.