I have a rails app generator and I need to sanitize app_name
in a few locations throughout my templates. It feels wrong to do it in every single spot that the sanitized_app_name
is needed but I am having a hard time finding documentation on this sort of thing.
Define a constant:
APP_NAME = ->(input) { ...sanitizing code ... }.(:real_app_name)
and use it everywhere.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments