instance method with_fallbacks

Ruby on Rails 6.1.7.10

Since v3.0.20 Last seen in v6.1.7.10

Available in: v3.0.20 v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10

Signature

with_fallbacks()

Adds fallbacks to the view paths. Useful in cases when you are rendering a :file.

Source
# File actionview/lib/action_view/lookup_context.rb, line 147
      def with_fallbacks
        view_paths = build_view_paths((@view_paths.paths + self.class.fallbacks).uniq)

        if block_given?
          raise ArgumentError, <<~eowarn.squish
          Calling `with_fallbacks` with a block is not supported. Call methods on
          the lookup context returned by `with_fallbacks` instead.
          eowarn
        else
          ActionView::LookupContext.new(view_paths, @details, @prefixes)
        end
      end

Defined in actionview/lib/action_view/lookup_context.rb line 147 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::LookupContext::ViewPaths

Type at least 2 characters to search.

↑↓ navigate · open · esc close