From 010bd343157ae02c95709359f0137d45e562e629 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 22 Feb 2014 07:40:29 -0700 Subject: extract partial for location. --- README.md | 1 + app/views/v1/licenses/_license.json.jbuilder | 6 +----- app/views/v1/licenses/_location.json.jbuilder | 5 +++++ 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 app/views/v1/licenses/_location.json.jbuilder diff --git a/README.md b/README.md index 2727bdb..e8076f5 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ LicenseStatus (flyweight, state) * finish json views * add well statuses and well types to json response. * rename license to well license +* add applicant name to users * update deploy script to seed db. * update license status to use a hash * add pagination to company licenses controller diff --git a/app/views/v1/licenses/_license.json.jbuilder b/app/views/v1/licenses/_license.json.jbuilder index 58b9282..607ce60 100644 --- a/app/views/v1/licenses/_license.json.jbuilder +++ b/app/views/v1/licenses/_license.json.jbuilder @@ -1,10 +1,6 @@ json.id license.id json.partial! 'v1/licenses/well_type', well_type: license.well_type - json.location do - json.township license.location.township - json.latitude license.location.latitude - json.longitude license.location.longitude - end + json.partial! 'v1/licenses/location', location: license.location json.company do json.name license.company.name end diff --git a/app/views/v1/licenses/_location.json.jbuilder b/app/views/v1/licenses/_location.json.jbuilder new file mode 100644 index 0000000..5b43756 --- /dev/null +++ b/app/views/v1/licenses/_location.json.jbuilder @@ -0,0 +1,5 @@ +json.location do + json.township location.township + json.latitude location.latitude + json.longitude location.longitude +end -- cgit v1.2.3