blob: d2901dde6ffc20627149d219955b8c4e2e9ffd09 (
plain)
1
2
3
4
5
6
7
8
9
10
|
class FavoritesController < ApplicationController
before_action :authenticate!
def create
cake = Creation.find(params[:cake_id])
current_user.add_favorite(cake)
redirect_to cake_path(cake), notice: "This has been added to your favorites"
end
end
|