Class: MetadataController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- MetadataController
- Defined in:
- app/controllers/metadata_controller.rb
Instance Method Summary collapse
-
#annotators ⇒ Object
/metadata/annotators.json.
- #get_klass ⇒ Object protected
- #index ⇒ Object
- #object_navigation ⇒ Object
-
#object_radial ⇒ Object
:klass is a base class name, like “Otu”.
- #related_summary ⇒ Object
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#annotators ⇒ Object
/metadata/annotators.json
29 30 31 |
# File 'app/controllers/metadata_controller.rb', line 29 def annotators render json: helpers.klass_annotations end |
#get_klass ⇒ Object (protected)
35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/metadata_controller.rb', line 35 def get_klass render json: {status: 400} if (params[:type] && params[:global_id]) || (params[:type].blank? && params[:global_id].blank?) if params[:type] @klass = params[:type] @object = nil else @object = GlobalID::Locator.locate(params.require(:global_id)) @klass = OBJECT_RADIALS[@object.class.name] ? @object.class.name : @object.class.base_class.name end end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/metadata_controller.rb', line 6 def index @klass = params[:klass] render '/shared/data/metadata/index' end |
#object_navigation ⇒ Object
18 19 20 21 |
# File 'app/controllers/metadata_controller.rb', line 18 def @object = GlobalID::Locator.locate(params.require(:global_id)) render json: {status: 200} end |
#object_radial ⇒ Object
:klass is a base class name, like “Otu”
12 13 14 15 16 |
# File 'app/controllers/metadata_controller.rb', line 12 def object_radial get_klass @data = OBJECT_RADIALS[@klass] render '/workbench/navigation/object_radial' end |
#related_summary ⇒ Object
23 24 25 26 |
# File 'app/controllers/metadata_controller.rb', line 23 def @klass = params.require(:klass).safe_constantize render json: @klass.(params.require(:id)) end |