Hi all, at the end of week four Matthew introduces the current_user helper method and puts it in the ApplicationController. He then uses it in the DeskController starting with the index action as so,
def index
@decks = Deck.all
end
becomes,
def index
@decks = current_user.decks
end
I understand that current_user returns an User object if there’s one to return. My question is, where does that decks method come from? A first guess is that is path_helper method. The following is an excerpt from rake routes:
decks GET /decks(.:format) decks#index
But then what about:
def new
@deck = current_user.deck.new
end
and,
def find_deck
current_user.decks.find(params[:id])
end
I’ve gotten everything up until this point, but If that’s not it I’m lost.