Updated gems and refactored Notes controller

Added a before_action command to reduce code duplication
for future endeavors.