app/controllers/roles_controller.rb
def load_role
    @role = Role.find( params[:id] ) if params[:id]
    
  rescue ActiveRecord::RecordNotFound
    flash[:notice] = "No such role"
    redirect_to :action => :index    
  end
#
# Loads role if params[:id] is given. This method should be called in before_filter.
#

Loads role if params[:id] is given. This method should be called in before_filter.
Loads role if params [ : id ] is given . This method should be called in before_filter .
def load_role
    @role = Role.find( params[:id] ) if params[:id]
  rescue ActiveRecord::RecordNotFound
    flash[:notice] = "No such role"
    redirect_to :action => :index    
  end
def load_role @role = Role . find ( params [ :id ] ) if params [ :id ] rescue ActiveRecord :: RecordNotFound flash [ :notice ] = "No such role" redirect_to :action => :index end
Loads role if params[:id] is given.
Loads role if params [ : id ] is given .