aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/refinery/banners
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/refinery/banners')
-rw-r--r--app/controllers/refinery/banners/admin/banners_controller.rb12
-rw-r--r--app/controllers/refinery/banners/banners_controller.rb34
2 files changed, 46 insertions, 0 deletions
diff --git a/app/controllers/refinery/banners/admin/banners_controller.rb b/app/controllers/refinery/banners/admin/banners_controller.rb
new file mode 100644
index 0000000..1992bcf
--- /dev/null
+++ b/app/controllers/refinery/banners/admin/banners_controller.rb
@@ -0,0 +1,12 @@
+module Refinery
+ module Banners
+ module Admin
+ class BannersController < ::Refinery::AdminController
+
+ crudify :'refinery/banners/banner',
+ :title_attribute => 'name', :xhr_paging => true
+
+ end
+ end
+ end
+end
diff --git a/app/controllers/refinery/banners/banners_controller.rb b/app/controllers/refinery/banners/banners_controller.rb
new file mode 100644
index 0000000..5ada5e0
--- /dev/null
+++ b/app/controllers/refinery/banners/banners_controller.rb
@@ -0,0 +1,34 @@
+module Refinery
+ module Banners
+ class BannersController < ::ApplicationController
+
+ before_filter :find_all_banners
+ before_filter :find_page
+
+ def index
+ # you can use meta fields from your model instead (e.g. browser_title)
+ # by swapping @page for @banner in the line below:
+ present(@page)
+ end
+
+ def show
+ @banner = Banner.find(params[:id])
+
+ # you can use meta fields from your model instead (e.g. browser_title)
+ # by swapping @page for @banner in the line below:
+ present(@page)
+ end
+
+ protected
+
+ def find_all_banners
+ @banners = Banner.order('position ASC')
+ end
+
+ def find_page
+ @page = ::Refinery::Page.where(:link_url => "/banners").first
+ end
+
+ end
+ end
+end