diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-22 12:14:00 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-22 12:14:00 -0700 |
| commit | c7790748349449d9e6eb2c2a43c93bd2faf1a70d (patch) | |
| tree | b10793ae95fdf78019a41cc4ee94330a8b56ec4a /app | |
| parent | 4e7bab146a58bd3a985db87de58bf6115ba084e8 (diff) | |
pass location json to partial. active records lazy instantiation of has_one relationship keeps returning nil.
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/v1/licenses/_license.jbuilder | 2 | ||||
| -rw-r--r-- | app/views/v1/licenses/_location.jbuilder | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/views/v1/licenses/_license.jbuilder b/app/views/v1/licenses/_license.jbuilder index b62f91b..9d04606 100644 --- a/app/views/v1/licenses/_license.jbuilder +++ b/app/views/v1/licenses/_license.jbuilder @@ -1,6 +1,6 @@ json.id license.id json.status license.status.to_s -#json.partial! 'v1/licenses/location', location: license.location +json.partial! 'v1/licenses/location', location: license.to_json if license.confidential? json.partial! 'v1/licenses/confidential_well_type', well_type: license.well_type json.partial! 'v1/licenses/confidential_company' diff --git a/app/views/v1/licenses/_location.jbuilder b/app/views/v1/licenses/_location.jbuilder index 5b43756..b9c0625 100644 --- a/app/views/v1/licenses/_location.jbuilder +++ b/app/views/v1/licenses/_location.jbuilder @@ -1,5 +1,5 @@ json.location do - json.township location.township - json.latitude location.latitude - json.longitude location.longitude + json.township location["township"] + json.latitude location["latitude"] + json.longitude location["longitude"] end |
