json with nested assets
This commit is contained in:
parent
0fe6a71380
commit
067c5b9c3c
@ -7,7 +7,7 @@ class CampaignsController < ApplicationController
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
format.json { render json: @campaign }
|
||||
format.json { render json: @campaign, include: [:videolistings,] }
|
||||
format.html { render html: @campaign }
|
||||
end
|
||||
end
|
||||
|
@ -12,4 +12,5 @@ class Campaign < ActiveRecord::Base
|
||||
#TODO Make API Calls
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
@ -4,6 +4,6 @@ class Videolisting < ActiveRecord::Base
|
||||
validates :producttypeid, presence: true
|
||||
|
||||
def asseturls_array
|
||||
self.asseturls.split(',').collect(&:strip)
|
||||
self.asseturls.split(',').collect { |url| { asseturl: url.strip } }
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user