Sha256: 2b5edfd9072c824adbd2df909a43a135d5d6df909386f127d19002fb7fd861d3
Contents?: true
Size: 546 Bytes
Versions: 4
Compression:
Stored size: 546 Bytes
Contents
# frozen_string_literal: true require_relative "nice_partials/version" module NicePartials def self.locale_prefix_from(lookup_context, block) partial_location = block.source_location.first.dup lookup_context.view_paths.each { partial_location.delete_prefix!(_1.path)&.delete_prefix!("/") } partial_location.split('.').first.gsub('/_', '/').gsub('/', '.') end end ActiveSupport.on_load :action_view do require_relative "nice_partials/monkey_patch" require_relative "nice_partials/helper" include NicePartials::Helper end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
nice_partials-0.9.3 | lib/nice_partials.rb |
nice_partials-0.9.2 | lib/nice_partials.rb |
nice_partials-0.9.1 | lib/nice_partials.rb |
nice_partials-0.9.0 | lib/nice_partials.rb |