add favorite/unfavorite links to mobile page

This commit is contained in:
r888888888
2014-09-05 16:46:22 -07:00
parent 719343cea5
commit 0e203c5cda
4 changed files with 30 additions and 1 deletions

View File

@@ -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