Best way to approach these 2?
Morning everyone,
I have two issues. First off, I have a meal planning app. I want to display # of recipes #&# mealplans a particular user has (obviously user would have to be logged in). I can use recipes.count, but that counts ALL the recipes in the db regardless of whether they belong to logged in user or not.
Secondly, can <% if signed_in? %> be used in routes.rb? What I am trying to accomplish, is I'd like to have two different root paths, one for signed in users, and one for ppl that don't have accounts/aren't signed in.
What would be the best way to take care of these two things? Thanks to everyone that helps :)