I am writing a rails engine.
I have two methods(authenticate and current_user) in the gem inside application controller. https://github.com/krunal/aadhar/blob/master/app/controllers/aadhar/application_controller.rb
I want 'authenticate' method should be available as a before_filter in parent rails application.
I want 'current_user' method should be available as a method and helper in parent rails application .
I don't know how can I achieve that.
Let say in my parent application, I have a posts controller. I want to use 'authenticate' and 'current_user' this way.
PostsController < ApplicationController
before_filter :authenticate
def index
current_user.posts
end