Commit 36b244456d253f7c41cfd093a3ae19080f91c43b
1 parent
8924daed
Exists in
master
and in
29 other branches
Fix inclusion of theme files
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -387,10 +387,14 @@ module ApplicationHelper | @@ -387,10 +387,14 @@ module ApplicationHelper | ||
387 | end | 387 | end |
388 | 388 | ||
389 | def theme_include(template) | 389 | def theme_include(template) |
390 | - file = (Rails.root + '/public' + theme_path + '/' + template + '.html.erb') | ||
391 | - if File.exists?(file) | ||
392 | - return render :file => file, :use_full_path => false | 390 | + # XXX Since we cannot control what people are doing in external themes, we |
391 | + # will keep looking for the deprecated .rhtml extension here. | ||
392 | + ['.rhtml', '.html.erb'].each do |ext| | ||
393 | + file = File.join(Rails.root, 'public', theme_path, template + ext) | ||
394 | + if File.exists?(file) | ||
395 | + return render :file => file, :use_full_path => false | ||
393 | end | 396 | end |
397 | + end | ||
394 | nil | 398 | nil |
395 | end | 399 | end |
396 | 400 |