Показать сообщение отдельно

  #81  
Старый 08.01.2010, 19:27
superboy4
Banned
Регистрация: 17.07.2007
Сообщений: 179
Провел на форуме:
816011

Репутация: 23
Отправить сообщение для superboy4 с помощью ICQ
По умолчанию

geezer.code
please, tell me what this short code does....
I got it from guides.rubyonrails.org

PHP код:
class ApplicationController ActionController::Base
  helper 
:all # include all helpers, all the time
  
protect_from_forgery # See ActionController::RequestForgeryProtection for details

  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password
private
  
def current_user
    
@_current_user ||= session[:user_id] && User.find(session[:user_id])
  
end
  
  def require_login
    unless logged_in
?
      
flash[:error] = 'Войдите либо зарегистрируйтесь!'
      
redirect_to root_url
    end
  end
  
  def logged_in
?
    !!
current_user
  end
  
end 

Последний раз редактировалось superboy4; 09.01.2010 в 18:14..
 
Ответить с цитированием