add favorite/unfavorite links to mobile page
This commit is contained in:
@@ -24,10 +24,22 @@ class FavoritesController < ApplicationController
|
||||
else
|
||||
@error_msg = "You can only keep up to #{CurrentUser.favorite_limit} favorites. Upgrade your account to save more."
|
||||
end
|
||||
|
||||
respond_with(@post) do |format|
|
||||
format.html do
|
||||
redirect_to(mobile_post_path(@post))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@post = Post.find(params[:id])
|
||||
@post.remove_favorite!(CurrentUser.user)
|
||||
|
||||
respond_with(@post) do |format|
|
||||
format.html do
|
||||
redirect_to(mobile_post_path(@post))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user