Sha256: ec59f5d4ba063ae90fc3b661ce5efe3729296297d1e80d9b852a17d09c286c31

Contents?: true

Size: 425 Bytes

Versions: 22

Compression:

Stored size: 425 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! 'faalis/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

22 entries across 22 versions & 1 rubygems

Version Path
faalis-2.2.0.pre.rc1 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.2.1 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.2.0 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.1.1 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.1.0 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.8 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.7 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.5 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.4 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.3 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.1 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0.rc6 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0.rc5 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0.rc4 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0.rc3 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-2.0.0.rc2 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-1.0.0 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-1.0.0.alpha4 lib/generators/faalis/templates/views/show.json.jbuilder.erb
faalis-1.0.0.alpha3 lib/generators/faalis/templates/views/show.json.jbuilder.erb