You can find the answer in this RailsCast , pay attention, in particular, to the section "Configuring Templates". You create files in your Rails root directory lib/, so it will not apply to all applications, only your current ones, and it will not be independent of the versions of Rails.
source
share