app/controllers/application_controller.rb
# almost everything we do is restricted to a department so we always load_department
# feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department
feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department feel free to skip_before_filter when desired
def load_department
    if (params[:department_id])
      @department = Department.find(params[:department_id])
      if @department
        session[:department_id] = params[:department_id]
      end
    end
    @department ||= current_department
  end
def load_department if ( params [ :department_id ] ) @department = Department . find ( params [ :department_id ] ) if @department session [ :department_id ] = params [ :department_id ] end end @department ||= current_department end
almost everything we do is restricted to a department so we always load_department
feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department feel free to skip_before_filter when desired