Skip to content

Commit

Permalink
Change the default template handler from ERB to Raw.
Browse files Browse the repository at this point in the history
Files without a template handler in their extension will be rended
using the raw handler instead of ERB.
  • Loading branch information
rafaelfranca committed Jan 4, 2015
1 parent 34bcbcf commit 4be859f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 7 additions & 0 deletions actionview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
* 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.

*Rafael Mendonça França*

* Remove deprecated `AbstractController::Base::parent_prefixes`.

*Rafael Mendonça França*
Expand Down
4 changes: 2 additions & 2 deletions actionview/lib/action_view/template/handlers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module Handlers #:nodoc:
autoload :Raw, 'action_view/template/handlers/raw'

def self.extended(base)
base.register_default_template_handler :erb, ERB.new
base.register_default_template_handler :raw, Raw.new
base.register_template_handler :erb, ERB.new
base.register_template_handler :builder, Builder.new
base.register_template_handler :raw, Raw.new
base.register_template_handler :ruby, :source.to_proc
end

Expand Down
6 changes: 0 additions & 6 deletions actionview/lib/action_view/template/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@ def extract_handler_and_format_and_variant(path, default_formats)
pieces.shift

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

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

0 comments on commit 4be859f

Please sign in to comment.