rails/jbuilder — Issue #24: Specify custom partial
Author: mattdbridges
Created: 2012-02-21 00:37:51+00:00
State: open

I am trying to use the `partial!` method to output nested relationships in a Rails app like so:

```ruby
json.array!(@departments) do |json, department|
json.partial! department
json.jobs department.jobs do |json, job|
json.partial! job
end
json.staff department.users do |json, user|
json.partial! 'app/views/staffs/staff', user
end
end
```

My partial the staffs is actually calling the `User` model, but because of the way we are using routes, we have the views under `staffs`. Is there any way to a custom view path with a different name than the model being used, or does it have to be the same?