Module: SchoolieHelper
- Defined in:
- lib/helpers/schoolie_helper.rb
Overview
though can be overridden
Instance Method Summary collapse
Instance Method Details
#schoolie_tags(concern, config = Rails.root.join("config/schoolie.yml")) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/helpers/schoolie_helper.rb', line 8 def (concern, config = Rails.root.join("config/schoolie.yml")) m = load_map(config) = m["static"].map do |k, v| tag.(name: k, value: v) end = m["attributes"].inject() do |m, (k, v)| begin [concern.send(v)].flatten.each do |z| m << tag.(name: k, value: z) end rescue StandardError warn("Undefined attribute mapping: #{k} -> #{v}") end m end .join("\n") end |