diff --git a/lib/mobylette/resolvers/chained_fallback_resolver.rb b/lib/mobylette/resolvers/chained_fallback_resolver.rb index 24cca05..5d7e261 100644 --- a/lib/mobylette/resolvers/chained_fallback_resolver.rb +++ b/lib/mobylette/resolvers/chained_fallback_resolver.rb @@ -1,3 +1,6 @@ +require 'action_view' +require 'action_view/template/resolver' + module Mobylette module Resolvers class ChainedFallbackResolver < ::ActionView::FileSystemResolver @@ -24,9 +27,9 @@ def initialize(formats = {}, view_paths = ['app/views']) # ... # } # - # It will add the fallback chain array of the + # It will add the fallback chain array of the # request.format to the resolver. - # + # # If the format.request is not defined in formats, # it will behave as a normal FileSystemResovler. # @@ -39,11 +42,11 @@ def replace_fallback_formats_chain(formats) # Private: finds the right template on the filesystem, # using fallback if needed # - def find_templates(name, prefix, partial, details) + def find_templates(name, prefix, partial, details, outside_app_allowed = false) # checks if the format has a fallback chain if @fallback_formats.has_key?(details[:formats].first) details = details.dup - details[:formats] = Array.wrap(@fallback_formats[details[:formats].first]) + details[:formats] = Array.wrap(@fallback_formats[details[:formats].first]) end super(name, prefix, partial, details) end diff --git a/lib/mobylette/respond_to_mobile_requests.rb b/lib/mobylette/respond_to_mobile_requests.rb index a47ece6..3f99aa1 100644 --- a/lib/mobylette/respond_to_mobile_requests.rb +++ b/lib/mobylette/respond_to_mobile_requests.rb @@ -33,7 +33,7 @@ module RespondToMobileRequests helper_method :is_mobile_view? helper_method :request_device? - before_filter :handle_mobile + before_action :handle_mobile cattr_accessor :mobylette_options @@mobylette_options = Hash.new @@ -101,7 +101,7 @@ def mobylette_config # Private: Configures how the resolver shall handle fallbacks. # - # if options has a :fallback_chains key, it will use it + # if options has a :fallback_chains key, it will use it # as the fallback rules for the resolver, the format should # be a hash, where each key defines a array of formats. # Example: @@ -213,7 +213,7 @@ def set_mobile_format return device if request_device?(device) end end - :mobile + :mobile end end