16 lines
327 B
Ruby
16 lines
327 B
Ruby
class FavoritesController < ApplicationController
|
|
def create
|
|
@favorite = Favorite.create(
|
|
:user_id => @current_user.id,
|
|
:post_id => params[:favorite][:post_id]
|
|
)
|
|
end
|
|
|
|
def destroy
|
|
Favorite.destroy(
|
|
:user_id => @current_user.id,
|
|
:post_id => params[:favorite][:post_id]
|
|
)
|
|
end
|
|
end
|