5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/jpmobile/fallback_view_selector.rb', line 5
def _render_template(options)
if Jpmobile.config.fallback_view_selector &&
lookup_context.mobile.present? && !lookup_context.mobile.empty?
begin
expected_view_file = lookup_context.find_template(options[:template], options[:prefixes])
_candidates = lookup_context.mobile.filter_map do |variant|
target_template = options[:template] + '_' + variant
expected_view_file.virtual_path.match(target_template)
end
if _candidates.empty?
lookup_context.mobile = []
end
rescue ActionView::MissingTemplate
end
end
super
end
|