adbanner-test/app/controllers/ad_banners_controller.rb

22 lines
505 B
Ruby
Raw Normal View History

2014-04-11 07:47:33 +00:00
class AdBannersController < ApplicationController
def widget
2014-04-15 07:51:02 +00:00
adbanner = Banner.first
images = adbanner.ad_images.collect do |b|
2014-04-11 07:47:33 +00:00
{
2014-04-15 07:51:02 +00:00
"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,
2014-04-11 07:47:33 +00:00
"more" => "More"
}
end
{
"extras" => {},
2014-04-15 07:51:02 +00:00
"data" => images
2014-04-11 07:47:33 +00:00
}
end
end