How can we access rails helper function inside controllers globally

    Create and function in ApplicationHelper and include that helper in ApplicationConroller sepcifying the name of helper metod
    #application_controller.rb

    class ApplicationController < ActionController::Base
          include ApplicationHelper
            helper_method :acessed_anywhere

    end

    #application_helper.rb

    module ApplicationHelper

      def acessed_anywhere

      end
    end
    5
    Average: 5 (1 vote)