prepend_before_action in Rails

Rails encourages usage of callbacks in controllers to execute common pieces of ┬ácode before or after an action. A very simple example of this is calling the authenticate_user! method from Devise before every action to make sure that user is authenticated.class ApplicationController < ActionController::Base before_action :authenticate_…