app/controllers/users_controller.rb
#
# Loads user if params[:id] is given. This method should be called in before_filter.
#

Loads user if params[:id] is given. This method should be called in before_filter.
Loads user if params [ : id ] is given . This method should be called in before_filter .
def load_user
    @user = User.find( params[:id] ) if params[:id]
  rescue ActiveRecord::RecordNotFound
    flash[:notice] = "User not found"
    redirect_to :action => :index 
  end
def load_user @user = User . find ( params [ :id ] ) if params [ :id ] rescue ActiveRecord :: RecordNotFound flash [ :notice ] = "User not found" redirect_to :action => :index end
Loads user if params[:id] is given.
Loads user if params [ : id ] is given .