From a0e12f5a83d2fa0996c69cd207cd902fff949b7a Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 15 Apr 2014 15:51:02 +0800 Subject: [PATCH] fixed frontend controller method. --- app/controllers/ad_banners_controller.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb index 54178de..c4f8a2a 100644 --- a/app/controllers/ad_banners_controller.rb +++ b/app/controllers/ad_banners_controller.rb @@ -1,20 +1,21 @@ class AdBannersController < ApplicationController def widget - adbanners = Banner.all - banner = adbanners.collect do |b| + adbanner = Banner.first + images = adbanner.ad_images.collect do |b| { - "ad_fx" => b.ad_fx, - "height" => b.body, - "wight" => b.weight, - "speed" => b.speed, - "title" => b.title, - "timeout" => b.timeout, + "ad_fx" => adbanner.ad_fx, + "height" => adbanner.height, + "width" => adbanner.width, + "speed" => adbanner.speed, + "title" => adbanner.title, + "timeout" => adbanner.timeout, + "image_link" => b.file.url, "more" => "More" } end { "extras" => {}, - "data" => banner + "data" => images } end end