diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 339b4197df5b1b45889a3790556746fd58494097..f9af8934fd5a320835975e96552d72180f56837e 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -33,7 +33,7 @@ *Sergey Nartimov* -* Add .rb template handler, this handler simply allows arbitrary Ruby code as a template. *Guillermo Iguaran* +* Add .ruby template handler, this handler simply allows arbitrary Ruby code as a template. *Guillermo Iguaran* * Add `separator` option for `ActionView::Helpers::TextHelper#excerpt`: diff --git a/actionpack/lib/action_view/template/handlers.rb b/actionpack/lib/action_view/template/handlers.rb index 47e572967a50f8ff58f6911fab387f6daa066554..d9cddc004044170e13fd2f1ae0e4f745cf5aa25f 100644 --- a/actionpack/lib/action_view/template/handlers.rb +++ b/actionpack/lib/action_view/template/handlers.rb @@ -10,7 +10,7 @@ def self.extended(base) base.register_default_template_handler :erb, ERB.new base.register_template_handler :builder, Builder.new base.register_template_handler :raw, Raw.new - base.register_template_handler :rb, :source.to_proc + base.register_template_handler :ruby, :source.to_proc end @@template_handlers = {} diff --git a/actionpack/test/fixtures/ruby_template.rb b/actionpack/test/fixtures/ruby_template.ruby similarity index 100% rename from actionpack/test/fixtures/ruby_template.rb rename to actionpack/test/fixtures/ruby_template.ruby diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 16a43fa0dff5c973cad02082625f6cef1f221828..ddf5c6a1b3dd58a68518e91d08e356ffb0fa7cd7 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -97,12 +97,12 @@ def test_render_raw_template_with_quotes assert_equal %q;Here are some characters: !@#$%^&*()-="'}{`; + "\n", @view.render(:template => "plain_text_with_characters") end - def test_render_rb_template_with_handlers + def test_render_ruby_template_with_handlers assert_equal "Hello from Ruby code", @view.render(:template => "ruby_template") end - def test_render_rb_template_inline - assert_equal '4', @view.render(:inline => "(2**2).to_s", :type => :rb) + def test_render_ruby_template_inline + assert_equal '4', @view.render(:inline => "(2**2).to_s", :type => :ruby) end def test_render_file_with_localization_on_context_level