Class: AnnotationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/annotations_controller.rb

Instance Method Summary collapse

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form

Methods included from Api::Intercept

#intercept_api

Instance Method Details

#metadataObject

GET /annotations/:global_id/metadata



6
7
8
9
10
# File 'app/controllers/annotations_controller.rb', line 6

def 
  @object = GlobalID::Locator.locate(params.require(:global_id))
  render(json: { success: false}, status: :not_found) and return if @object.nil?
  render(json: { 'message' => 'Record not found' }, status: :unauthorized) if !@object.is_community? && @object.project_id != sessions_current_project_id
end

#typesObject

GET /annotations/types (JSON)



13
14
# File 'app/controllers/annotations_controller.rb', line 13

def types
end