Sha256: 7feb28cc6964c07299c302ba6f2fdb599cd55d6bc8635cb5bee11248a4843b13

Contents?: true

Size: 429 Bytes

Versions: 1

Compression:

Stored size: 429 Bytes

Contents

json.id @<%= resource.underscore %>.id.to_s
json.extract! @<%= resource.underscore %><%= fields_as_params %><% fields.each do |name, type| %>
<% case type
when "belongs_to" %>
json.partial! 'underworld/relations/belongs_to', object: @<%= resource.underscore %>.<%= name %>, :name => :<%= name %>, :fields => [:id, :name]
<% when "has_many" %>json.<%= name %> @<%= resource.underscore %>.<%= name %>, :id, :name<% end %><% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
underworld-1.0.0 lib/generators/underworld/templates/views/show.json.jbuilder.erb