i am making a ecommerce application in which the categories are visible in side bar on all pages. i wrote a method in application controller
def categories
@categories = Category.all
end
but how can i make this method available to all controllers and actions by default so that i dont have to specifically call this method in every action
def list
categories
@products = Product.order('title').page(params[:page]).per(4)
end