Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def login return unless request.post? self.current_user = User.authenticate(params[:login], params[:password]) if logged_in? if params[:remember_me] == "1" self.current_user.remember_me cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } end # add this line cookies[:vendor] = "no-auto-reset" # back to your regularly scheduled diversion redirect_back_or_default(:controller => :business, :action => :show) flash[:notice] = "Logged in successfully" else flash[:warning ] = "Incorrect username or password" redirect_back_or_default(:controller => :home, :action => :index) end end
This paste will be private.
From the Design Piracy series on my blog: