I have code in a rails helper that is being used in a view and i also have the same code in a background worker class.
How do i extract this code out into its own class or module to use for both the helper and background class?
Please can any one help.
To me, code that needs to be shared between background tasks and rails goes logically in
lib/my_library.rb. Justrequire 'my_library'in your controller and job files.lib/my_library.rb:
In app/jobs/my_job.rb: