aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2017-12-17 11:36:55 +0100
committerHarald Eilertsen <haraldei@anduin.net>2017-12-17 11:38:07 +0100
commit9be44b3fa9985b8a93160434ce9f6dc922ec4387 (patch)
treecf488691c1168caf9e02be7830635da76b3bc57b /vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb
parent302aadd8bfd4030d9b2a71d5121fd650c0918338 (diff)
downloadhmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.tar.gz
hmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.tar.bz2
hmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.zip
New extension GalleryLinks
Diffstat (limited to 'vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb')
-rw-r--r--vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb
new file mode 100644
index 0000000..c6a4e7e
--- /dev/null
+++ b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb
@@ -0,0 +1,34 @@
+module Refinery
+ module GalleryLinks
+ class GalleryLinksController < ::ApplicationController
+
+ before_filter :find_all_gallery_links
+ before_filter :find_page
+
+ def index
+ # you can use meta fields from your model instead (e.g. browser_title)
+ # by swapping @page for @gallery_link in the line below:
+ present(@page)
+ end
+
+ def show
+ @gallery_link = GalleryLink.find(params[:id])
+
+ # you can use meta fields from your model instead (e.g. browser_title)
+ # by swapping @page for @gallery_link in the line below:
+ present(@page)
+ end
+
+ protected
+
+ def find_all_gallery_links
+ @gallery_links = GalleryLink.order('position ASC')
+ end
+
+ def find_page
+ @page = ::Refinery::Page.where(:link_url => "/gallery_links").first
+ end
+
+ end
+ end
+end