method

merge_prefix_into_object_path

Importance_0
v5.1.7 - Show latest stable - 0 notes - Class: PartialRenderer
merge_prefix_into_object_path(prefix, object_path) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 495
      def merge_prefix_into_object_path(prefix, object_path)
        if prefix.include?(//) && object_path.include?(//)
          prefixes = []
          prefix_array = File.dirname(prefix).split("/")
          object_path_array = object_path.split("/")[0..-3] # skip model dir & partial

          prefix_array.each_with_index do |dir, index|
            break if dir == object_path_array[index]
            prefixes << dir
          end

          (prefixes << object_path).join("/")
        else
          object_path
        end
      end
Register or log in to add new notes.