#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/5.3+-+Oggetti+impliciti+nei+controller # Check the page for copyright notice and explanations # effettuo due azioni diverse in base al metodo utilizzato def check_method if request.post? # salvo l'oggetto su db else # mostro il form end # pseudo azione incaricata di autenticare l'utente corrente def login if User.find_by_username_and_password(params[:username], params[:password]) if params[:remember_me] cookie[:logged] = true end session[:logged] = true end