Last active
March 14, 2021 13:51
-
-
Save gitDbits/fcfc6d44cde21b537297f9a10d742abd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
@lesson = Lesson.find(params[:id]) if current_user | |
@lesson = Lesson.by_teacher(current_teacher).find(params[:id]) if current_teacher | |
rescue ActiveRecord::RecordNotFound => e | |
redirect_to lessons_path, flash: { warning: "Impossible localized record" } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment