Jbuilder: render collections of partials
This commit is contained in:
parent
1c8881e20d
commit
8c20bc1d98
19 changed files with 43 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
|||
json.partial! "api/root_attributes"
|
||||
|
||||
json.elements(@nodes) do |node|
|
||||
json.partial! node
|
||||
json.elements do
|
||||
json.array! @nodes, :partial => "node", :as => :node
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
json.partial! "api/root_attributes"
|
||||
|
||||
json.elements([@node]) do |node|
|
||||
json.partial! node
|
||||
json.elements do
|
||||
json.array! [@node], :partial => "node", :as => :node
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue