public
Description: The easy to use rails wiki
Homepage: http://signalwiki.com
Clone URL: git://github.com/queso/signal-wiki.git
commit  97e1874d38dc94079b9205b3cba0b341b3085fc5
tree    2acd64707634af291fae9a4b9e198c65760ec840
parent  ef22344ab94f249f9318c5e5bf5d93e436364d38
signal-wiki / app / controllers / application.rb
100644 23 lines (17 sloc) 0.576 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
 
class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  require 'redcloth'
  include AuthenticatedSystem
  include CacheableFlash
 
  before_filter :find_site
  helper_method :site
  attr_reader :site
  
  def find_site
    @site ||= Site.find(:first)
  end
  
  def require_admin
    redirect_to(page_path('home')) unless logged_in? && current_user.admin?
  end
  
end