Class: AnnotationsController

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

Instance Attribute Summary

Attributes inherited from ApplicationController

#is_data_controller, #is_task_controller, #meta_data, #meta_description, #meta_keywords, #meta_title, #page_title, #site_name

Instance Method Summary (collapse)

Methods inherited from ApplicationController

#clear_project_and_user_variables, #digest_cookie, #digested_cookie_exists?, #disable_turbolinks, #intercept_api, #invalid_object, #is_data_controller?, #is_task_controller?, #log_user_recent_route, #notice_user, #project_matches, #record_not_found, #set_project_and_user_variables, #set_project_from_params, #token_authenticate

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) metadata

GET /annotations/:global_id/metadata



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

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

- (Object) show

GET /annotations/global_id



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

def show
end