FEATURE: bookmark topic button

This commit is contained in:
Régis Hanol
2015-01-12 12:10:15 +01:00
parent a9ef92f3d8
commit c681b353f2
14 changed files with 103 additions and 48 deletions

View File

@ -248,13 +248,13 @@ class PostsController < ApplicationController
def bookmark
post = find_post_from_params
if current_user
if params[:bookmarked] == "true"
PostAction.act(current_user, post, PostActionType.types[:bookmark])
else
PostAction.remove_act(current_user, post, PostActionType.types[:bookmark])
end
if params[:bookmarked] == "true"
PostAction.act(current_user, post, PostActionType.types[:bookmark])
else
PostAction.remove_act(current_user, post, PostActionType.types[:bookmark])
end
render nothing: true
end