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