pluralize resource name in python example
authorTom Clegg <tom@clinicalfuture.com>
Tue, 18 Jun 2013 15:47:57 +0000 (11:47 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Tue, 18 Jun 2013 17:56:56 +0000 (13:56 -0400)
apps/workbench/app/views/application/_arvados_object.html.erb

index da04b0d811e312dcf5c2f8d6d2f4a5cf7b847e27..900955236689b53015f67b11a883c8e2625c75b6 100644 (file)
@@ -46,7 +46,7 @@
       <pre>
 curl -X PUT \
  -H "Authorization: OAuth2 $arv_api_token" \
- --data-urlencode <%= @object.class.to_s.singularize.underscore %>@/dev/stdin \
+ --data-urlencode <%= @object.class.to_s.underscore %>@/dev/stdin \
  <%= Rails.configuration.arvados_v1_base %>/<%= @object.class.to_s.pluralize.underscore %>/<%= @object.uuid %> \
  &lt;&lt;EOF
 <%= JSON.pretty_generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}) %>
@@ -58,19 +58,19 @@ EOF
 ARVADOS_API_HOST=<%= Rails.configuration.arvados_v1_base.sub '/arvados/v1','' %>
 ARVADOS_API_TOKEN=xxxxxxxxxxxxxxxxxxxxx
 
-arv --json --pretty <%= @object.class.to_s.singularize.underscore %> get \
+arv --json --pretty <%= @object.class.to_s.underscore %> get \
  --uuid <%= @object.uuid %>
 
-arv <%= @object.class.to_s.singularize.underscore %> update \
+arv <%= @object.class.to_s.underscore %> update \
  --uuid <%= @object.uuid %> \
- --<%= @object.class.to_s.singularize.underscore %> '<%= JSON.generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}).gsub("'","'\''") %>'
+ --<%= @object.class.to_s.underscore %> '<%= JSON.generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}).gsub("'","'\''") %>'
       </pre>
     </div>
     <div id="arvados-object-python" class="tab-pane fade">
       <pre>
 import arvados
 
-x = arvados.api().<%= @object.class.to_s.underscore %>().get(uuid='<%= @object.uuid %>').execute()
+x = arvados.api().<%= @object.class.to_s.pluralize.underscore %>().get(uuid='<%= @object.uuid %>').execute()
       </pre>
     </div>