My controller class has two before callbacks one from gem cancancan and other from within rails as:
load_and_authorize_resource
before_action :set_company, only: [:show, :edit, :update, :destroy]
Now my questions are:
1) Is the order correct for these callbacks ?
2) How 'load_and_authorize_resource' loads instance variables (means what's name of instance variable ? What if I would like to give a custom name for instance variable ?
3) In the above callback, does second one overrides the loaded instance variables of load_and_authorize_resource or creates its own set, what happens if we give custom name for instance variable. (say "@com=Company.find(params[:id])" instead of "@company=Company.find(params[:id])").
Sorry !!! if question doesn't make sense, I'm new to rails. Hoping your answers will let me better understand this question. Happy Coding.