Closed lizardbird closed 7 years ago
To clarify - I believe it is still working because when I manually go back to the post in question, the heart reflects the appropriate "favorited" status.
Hmm, I think that redirect_to :back
might tell the browser to just use the last page that already loaded. See if:
def remove_favorite
bowl = Bowl.find(params[:id]
Favorite.find_by(user: current_user, bowl: bowl).destroy
redirect_to bowl
end
helps
Yeah, that was the example used in the lesson on favorites and redirecting. Either way, I ended up trying bowl_path(@bowl)
and that worked. Resolved!
I think my favorites many-to-many is working, but when I click on the ♥, it throws a error.
I found guidance online that says
redirect_to :back
is deprecated and instead to useredirect_back fallback_location: root_path
but neither are working for me. Any help? Thx in advance!