Skip to content

Commit 4be859f

Browse files
committed
Change the default template handler from ERB to Raw.
Files without a template handler in their extension will be rended using the raw handler instead of ERB.
1 parent 34bcbcf commit 4be859f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

actionview/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* Change the default template handler from `ERB` to `Raw`.
2+
3+
Files without a template handler in their extension will be rended using the raw
4+
handler instead of ERB.
5+
6+
*Rafael Mendonça França*
7+
18
* Remove deprecated `AbstractController::Base::parent_prefixes`.
29

310
*Rafael Mendonça França*

actionview/lib/action_view/template/handlers.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ module Handlers #:nodoc:
77
autoload :Raw, 'action_view/template/handlers/raw'
88

99
def self.extended(base)
10-
base.register_default_template_handler :erb, ERB.new
10+
base.register_default_template_handler :raw, Raw.new
11+
base.register_template_handler :erb, ERB.new
1112
base.register_template_handler :builder, Builder.new
12-
base.register_template_handler :raw, Raw.new
1313
base.register_template_handler :ruby, :source.to_proc
1414
end
1515

actionview/lib/action_view/template/resolver.rb

-6
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,6 @@ def extract_handler_and_format_and_variant(path, default_formats)
251251
pieces.shift
252252

253253
extension = pieces.pop
254-
unless extension
255-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
256-
The file #{path} did not specify a template handler. The default is
257-
currently ERB, but will change to RAW in the future.
258-
MSG
259-
end
260254

261255
handler = Template.handler_for_extension(extension)
262256
format, variant = pieces.last.split(EXTENSIONS[:variants], 2) if pieces.last

0 commit comments

Comments
 (0)