app/controllers/application_controller.rb
# Takes a department; intended to be passed some_thing.department
Takes a department; intended to be passed some_thing.department
Takes a department ; intended to be passed some_thing . department
def require_department_membership(dept)
    unless current_user.departments.include?(dept)
      error_message = "You are not a member of the appropriate department."
      respond_to do |format|
        format.html do
          flash[:error] = error_message
          redirect_to access_denied_path and return false
        end
        format.js do
          render :update do |page|
            ajax_alert(page, "<strong>error:</strong> "+error_message);
          end
          return false
        end
      end
    end
    return true
  end
def require_department_membership ( dept ) unless current_user . departments . include? ( dept ) error_message = "You are not a member of the appropriate department." respond_to do | format | format . html do flash [ :error ] = error_message redirect_to access_denied_path and return false end format . js do render :update do | page | ajax_alert ( page , "<strong>error:</strong> " + error_message ) ; end return false end end end return true end
Takes a department; intended to be passed some_thing.department
Takes a department ; intended to be passed some_thing . department
dept