Skip to content

Instantly share code, notes, and snippets.

@DevGW
Last active March 3, 2023 16:18
Show Gist options
  • Save DevGW/008281237f8712a97332fbcd6fe80113 to your computer and use it in GitHub Desktop.
Save DevGW/008281237f8712a97332fbcd6fe80113 to your computer and use it in GitHub Desktop.
Ruby / Rails :: Adding a module to rails project #hha_ank
# Module can be used by any controller instead of helper.rb which is only for associated controller
### make sure to add
### config.autoload_paths += %W(#{config.root}/lib)
### to config/application.rb
# and don't forget to make the file in /lib/ with this format: modelname.rb
module MODULENAME
    def METHODNAME
    end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment