app/controllers/v1/questions_controller.rb
def author_verification (current_user, question, action)
      unless current_user.id == question.created_by.to_i
        return
      end
      if action == "update"
        question.update(question_params)
      else
        question.destroy
      end
    end
# Only enble authors to edit or delete questions
Only enble authors to edit or delete questions
Only enble authors to edit or delete questions
def author_verification (current_user, question, action)
      unless current_user.id == question.created_by.to_i
        return
      end
      if action == "update"
        question.update(question_params)
      else
        question.destroy
      end
    end
def author_verification ( current_user , question , action ) unless current_user . id == question . created_by . to_i return end if action == "update" question . update ( question_params ) else question . destroy end end
Only enble authors to edit or delete questions
Only enble authors to edit or delete questions
current_user
question
action