public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
set up before_filter to load @site

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1202 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Fri Jun 09 15:54:43 -0700 2006
commit  8f3fed0d09699729ad6b313f9a03a9380deb929f
tree    743655d4c3f0bd5d2445729b65503d007848033b
parent  abb681a5305294f1824d88342741f1ea8a321d6d
...
2
3
4
 
5
6
7
8
9
10
11
 
12
13
14
...
22
23
24
25
 
 
 
 
 
 
26
27
28
...
2
3
4
5
6
7
 
 
 
 
 
8
9
10
11
...
19
20
21
 
22
23
24
25
26
27
28
29
30
0
@@ -2,13 +2,10 @@
0
 # Likewise, all the methods added will be available for all controllers.
0
 class ApplicationController < ActionController::Base
0
   # wait until we have multiple sites before we deal with changing the cache root
0
+ before_filter :load_site
0
   #before_filter :set_cache_root
0
   helper_method :site
0
-
0
- def site
0
- # Redefine this method if you wish to fail on host without a site
0
- @site ||= Site.find_by_host(request.host) || Site.find(:first)
0
- end
0
+ attr_reader :site
0
 
0
   def render_liquid_template_for(template_type, assigns = {})
0
     headers["Content-Type"] ||= 'text/html; charset=utf-8'
0
@@ -22,7 +19,12 @@ class ApplicationController < ActionController::Base
0
     render :text => site.templates.render_liquid_for(template_type, assigns, self)
0
   end
0
   
0
- #protected
0
+ protected
0
+ def load_site
0
+ # Redefine this method if you wish to fail on host without a site
0
+ @site ||= Site.find_by_host(request.host) || Site.find(:first)
0
+ end
0
+
0
   # def set_cache_root
0
   # self.class.page_cache_directory = File.join([RAILS_ROOT, (RAILS_ENV == 'test' ? 'tmp' : 'public'), 'cache', site.host].compact)
0
   # end

Comments

    No one has commented yet.