How use helper method in lambda function?

I am going to use helper method in lambda function.

app/functions/my_function.rb

include ApplicationHelper
def lambda_handler(event:, context:)
  puts event
  puts context

  # get_event_details is defined in ApplicationHelper
  details = get_event_details(event) 
end

app/helpers/application_helper.rb

module ApplicationHelper
   def get_event_details(event)
      #code
   end
end

After deploying, I am getting this error.
uninitialized constant ApplicationHelper

Been pretty swamped. This will help though:

https://community.rubyonjets.com/t/accessing-jets-models-in-simple-functions/288/2

Hope others will also chime in. Thanks!

1 Like

It works properly.
Thank you, @tung :+1: