26 lines
520 B
Ruby
26 lines
520 B
Ruby
class ApplicationController < ActionController::Base
|
|
#before_action :check_installation
|
|
protect_from_forgery with: :exception
|
|
|
|
helper_method :current_company
|
|
|
|
#this is base api base controller to need to inherit.
|
|
#all token authentication must be done here
|
|
#response format must be set to JSON
|
|
def current_company
|
|
begin
|
|
return Company.first
|
|
rescue
|
|
return nil
|
|
end
|
|
|
|
end
|
|
|
|
private
|
|
def check_installation
|
|
if current_company.nil?
|
|
redirect_to install_path
|
|
end
|
|
end
|
|
end
|