Class: ListController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ListController
- Defined in:
- app/controllers/list_controller.rb
Overview
Copyright © 2007 Mobio Networks, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.
Instance Method Summary collapse
- #banner ⇒ Object
- #data_response ⇒ Object
- #err ⇒ Object
- #err_response ⇒ Object
- #get_images ⇒ Object
- #promo ⇒ Object
-
#send_log ⇒ Object
Log when image is viewed.
- #set_index ⇒ Object
- #sponsor ⇒ Object
-
#storeBackurl ⇒ Object
handle backurl to home.
- #view ⇒ Object
Instance Method Details
#banner ⇒ Object
52 53 54 55 |
# File 'app/controllers/list_controller.rb', line 52 def # Get ad server url from config manager @ad_url = MOBIO_CONFIG['adserver_url'] end |
#data_response ⇒ Object
79 80 |
# File 'app/controllers/list_controller.rb', line 79 def data_response end |
#err ⇒ Object
75 76 |
# File 'app/controllers/list_controller.rb', line 75 def err end |
#err_response ⇒ Object
77 78 |
# File 'app/controllers/list_controller.rb', line 77 def err_response end |
#get_images ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/list_controller.rb', line 21 def get_images # get all images in images directory or bn directory if params[:bn].nil? imgs = File::join RAILS_ROOT, 'public/images/*png' else imgs = File::join RAILS_ROOT, 'public/images/bn/*png' end files = Dir[imgs] @names = [] files.each do |x| filename = File.basename(x) img = [] img[0] = filename filename = params[:bn] + '/' + filename if params[:bn] img[1] = filename @names << img end headers['Content-Type']='application/xml' response = "<data/>" render :template => 'list/images.xml' end |
#promo ⇒ Object
81 82 |
# File 'app/controllers/list_controller.rb', line 81 def promo end |
#send_log ⇒ Object
Log when image is viewed
44 45 46 47 48 49 50 |
# File 'app/controllers/list_controller.rb', line 44 def send_log logger.info('***** Viewed image with id: ' + params[:id]) # Have to send some dummy back otherwise server chokes on nullpointer exception headers['Content-Type']='application/xml' render :template => 'list/response.xml' end |
#set_index ⇒ Object
73 74 |
# File 'app/controllers/list_controller.rb', line 73 def set_index end |
#sponsor ⇒ Object
62 63 64 65 66 |
# File 'app/controllers/list_controller.rb', line 62 def sponsor headers['Content-Type']='application/xml' response = '<data xmlns=""><info>sponsor ' + params[:id] + '</info></data>' render :template => 'list/response.xml' end |
#storeBackurl ⇒ Object
handle backurl to home
69 70 71 |
# File 'app/controllers/list_controller.rb', line 69 def storeBackurl backURL("recipe_burl") end |
#view ⇒ Object
57 58 59 60 |
# File 'app/controllers/list_controller.rb', line 57 def view # Get ad server url from config manager @ad_url = MOBIO_CONFIG['adserver_url'] end |