Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
application.rb before_filter :auth helper_method :current_user # Authorise user if possible def auth if session[:user_id].nil? then @current_user = User.guest else @current_user = User.find(session[:user_id]) end end def current_user @current_user end # Require login def require_login redirect_to '/login' if @current_user.guest? end
Pasted July 06, 200810:15AM EDT
Embed