app/helpers/courses_helper.rb
#Confirms user is course convenor before deleting/editing course
Confirms user is course convenor before deleting/editing course
Confirms user is course convenor before deleting / editing course
def course_convenor?(current_user, course)
      convenor = User.find_by_id(course.convenor.user_id)
      if convenor == current_user
        return true
      else
        return false
      end
    end
def course_convenor? ( current_user , course ) convenor = User . find_by_id ( course . convenor . user_id ) if convenor == current_user return true else return false end end
Confirms user is course convenor before deleting/editing course
Confirms user is course convenor before deleting / editing course
current_user
<not_specific>
course
<not_specific>