fixed frontend controller method.

This commit is contained in:
Harry Bomrah 2014-04-15 15:51:02 +08:00
parent c5457e08d6
commit a0e12f5a83
1 changed files with 10 additions and 9 deletions

View File

@ -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