Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created March 30, 2017 23:20
Show Gist options
  • Save jcoyne/835b0d790e3678a676d0ef88fa56a385 to your computer and use it in GitHub Desktop.
Save jcoyne/835b0d790e3678a676d0ef88fa56a385 to your computer and use it in GitHub Desktop.
Hydra mappings
# For each class of objects in the repository, map from...
# repository representation to object properties
# object properties to repository representation
# object properties to an index representation
# index representation to an HTML show page
# object properties to an HTML form
# HTML form output to object properties
# index search results to an HTML page
GenericWork:
repository:
title: DC.title
description: DC.description
index:
type: SimpleIndexer
properties:
title: [:stored_sortable]
presenter:
order:
- :title
- :description
properties:
title: [DC.title, :title_renderer]
description: DC.description
edit_form:
top:
- :title
- :description
- :rights
bottom:
- :location
properties:
title: [:required, :multiple] # string is assumed
description: [:textarea] # Singular, not required
rights: [:rights_selector] # Singular, custom rights selector, points at app/views/records/edit_fields/_rights_statement.html.erb
location: [:location_picker] # Singular, a custom location selector
#How do we map the form to multiple models?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment