I have a model of:
User has_many recipes, recipe belongs_to user
recipe has_many comments, comment belongs_to recipe
My Recipes is nested to comments and I can access comments on Recipes_controller without problem.
If I try to access it from user, I got undefined method error.
My users_controller:
@user = User.find(params[:id])
@recipes = @user.recipes.paginate(page: param[:page])
@comments = @user.recipes.comments
How do i access comments from user?