Is there a simpler way of returning the relationship row from a table to access the data stored there?
I have two models related using has_many :through and the third model set up as the in-between. My models consist of a User, Recipe, and RecipeInfo.
Right now, in order to access the data stored for a particular user's recipe info, I'm using a Rails query similar to this
info = @user.recipeInfos.where("recipe_id=#{@recipe.id}")
I'm wondering if there is a simpler way of accessing this single row of a User's Recipe info rather than using the .where() method.
Edit:
recipe = Recipe.find(params[:id])
user = current_user
current_user
is defined by sessions[:user_id] = current_user
when the user logs in.