README.md in archivesspace-client-0.2.0 vs README.md in archivesspace-client-0.3.0
- old
+ new
@@ -93,15 +93,15 @@
## Templates
Templates are an optional feature that can help simplify the effort of creating
json payloads for ArchivesSpace. Rather than construct the json programatically
-according to the schemas a `.erb` template can be used to generate payloads
-instead which are transformed to json automatically. There are a small number of
+according to the schemas a template can be used to generate payloads instead which
+are transformed to json automatically. There are a small number of
templates provided with the client, but you can create your own and access them
by setting the `ARCHIVESSPACE_CLIENT_TEMPLATES_PATH` envvar. A particularly simple
-template might look like:
+`erb` template might look like:
```erb
{
"digital_object_id": "<%= data[:digital_object_id] %>",
"title": "<%= data[:title] %>"
@@ -113,13 +113,15 @@
using a flat file structure (like csv) this can be a very convenient way of
assembling the payload. To process a template:
```ruby
data = { repo_code: 'ABC', name: 'ABC Archive', agent_contact_name: 'ABC Admin' }
-json = ArchivesSpace::Template.process(:repository_with_agent, data)
+json = ArchivesSpace::Template.process("repository_with_agent.json.erb", data)
response = client.post('/repositories/with_agent', json)
puts response.result.success? ? '=)' : '=('
```
+
+To view available templates use: `ArchivesSpace::Template.list`
## CLI
Create an `~/.asclientrc` file with a json version of the client configuration: