Created
July 29, 2020 11:08
-
-
Save poqudrof/7d392e7e4f25dc6b1a075713bc62873f to your computer and use it in GitHub Desktop.
RUBY - RAILS - Example on how to generate methods app-wide icons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example on how to generate methods app-wide icons | |
# FAS icons | |
names = %w[dealership profile home users user | |
ordered delivered | |
] | |
icons = %w[hotel user-circle home users user | |
box-open truck-loading | |
] | |
names.each_with_index do |name, index| | |
define_method "#{name}_icon" do | |
'fas fa-' + icons[index] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code can be added to your application helper.