Closed Nykke closed 7 years ago
Could you update your project 2 repo for me?
I just updated and pushed it
I know we talked about this in person but, I'd recommend nesting your category and recipe routes.
routes.rb
resources :categories do
resources :recipes, only: [:index, :show]
end
Then update your controller and your view accordingly. I think this will simplify the code you'll need for your views.
For your views, you'll pass in both your @receipe and @category.
For your controller itself, you should drop the Recipe.new and rather find the recipe based off of the relationship between the category id assigned to your recipes based off of the id of the category the user is clicking.
got it fixed without nesting. I was calling the names wrong.
👍
I'm having a hard time getting my show, I'm getting this error
this is what I have in my categories controller