Class: Api::UserLinksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/api/user_links_controller.rb

Instance Method Summary collapse

Instance Method Details

#hideObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/api/user_links_controller.rb', line 5

def hide
  if @entity.followee == current_user
    @entity.update(visible: false)
    render json: { data: { visible: @entity.visible? } }
  else
    message = "User #{current_user.id} is not followee for link #{@entity.id}"
    handle_http_404(message)
  end
end