aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/render_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Meaningful errors for unexpected partial arguments. Fixes #3573Tobias Svensson2011-11-191-0/+7
|
* Fix deprecation warnings in action pack test suite due to passing template ↵Matthew Daubert2011-10-251-4/+4
| | | | formats in the template name.
* Fix failing tests and add tests for :formats on partial.José Valim2011-09-231-5/+10
|
* Allow both sym and array for details options in #render. using ↵Nick Sutterer2011-09-231-0/+3
| | | | LC#registered_details to extract options.
* added tests for render :file/:template and the :formats/:handlers/:locale ↵Nick Sutterer2011-09-231-1/+17
| | | | options.
* Deprecate passing the template handler in the template name.José Valim2011-09-221-20/+22
| | | | | | For example, calling hello.erb is now deprecated. Since Rails 3.0 passing the handler had no effect whatsover. This commit simply deprecates such cases so we can clean up the code in later releases.
* Get rid of update_details in favor of passing details to find_template.José Valim2011-09-221-0/+5
|
* it is now possible to pass details options (:formats, :details, :locales, ↵Nick Sutterer2011-09-221-0/+6
| | | | ...) to #render, #find_template and friends. this doesn't change anything in global context.
* deprecating process_view_pathsAaron Patterson2011-08-091-1/+1
|
* Rename new method to_path to to_partial_path to avoid conflicts with ↵José Valim2011-08-011-2/+2
| | | | File#to_path and similar.
* Let ActiveModel instances define partial paths.Grant Hutchins & Peter Jaros2011-07-251-0/+30
| | | | | | Deprecate ActiveModel::Name#partial_path. Now you should call #to_path directly on ActiveModel instances.
* Added view template invalid name check, along with tests. No merges in commit.huskins2011-07-131-0/+9
|
* remove warning: assigned but unused variableSantiago Pastorino2011-06-081-2/+2
|
* Optimize the most common resolver case.José Valim2011-05-091-1/+1
|
* Buffer should be an option passed down to template rendering.José Valim2011-04-161-9/+0
|
* removes render :update from viewsXavier Noria2011-04-131-4/+0
|
* SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this testAaron Patterson2011-03-211-2/+2
|
* Add a test for 'render :layout'Anton Astashov2011-02-031-0/+5
| | | | | | | | | To make sure it will show block contents if it is placed after 'render :partial' [#5557 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Accept String value for render_partial :as optionAkira Matsuda2011-02-011-1/+6
| | | | | | [#6222 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Properly check the arity for template handlers.José Valim2010-12-091-0/+5
|
* Pass the view object as parameter to the handler. Useful if you need to ↵José Valim2010-11-171-0/+9
| | | | access the lookup context or other information when compiling the template.
* Tests added for rendering partial with layout, when the partial contains ↵Santiago Pastorino2010-11-131-0/+15
| | | | another render layout with block call
* Fix render partial with layout and no blockCarlos Antonio da Silva2010-11-111-0/+10
| | | | | | | | When using a render :partial with :layout call, without giving a block, if the given :partial had another render :partial call, the layout was not being rendered. This commit fixes this context by storing variables before rendering the partial, so they are not overrided in any successive call to render partials down the path. All ActionPack tests are ok.
* Fix issue with rendering partials and then yielding inside a render layout callCarlos Antonio da Silva2010-11-111-0/+20
| | | | | | | The given block was never being executed when another render :partial call existed before the yield call, due to the block being overriden. This commit also adds some more tests to render with :layout option.
* Do not allow templates coming from Fallback resolvers to store a virtual path.José Valim2010-10-101-1/+12
|
* fix rendering a partial with an array as its :object [#5746 state:resolved]Michael Koziarski2010-10-081-0/+4
| | | | | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> Conflicts: actionpack/lib/action_view/render/partials.rb
* Silence warnings here, only setting Encoding.default_external for testing.Emilio Tagua2010-09-281-2/+3
|
* Removing unnecessary code from render_testThiago Pradi2010-09-021-2/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Remove deprecated support to <% form_for %> and several ↵José Valim2010-08-291-9/+0
| | | | ActionController::Base methods.
* layout_for works again with objects as specified in the documentation and ↵José Valim & Carlos Antonio da Silva2010-08-111-0/+5
| | | | Rails 2.3 [#5357 state:resolved]
* render(:inline) in a layout before yield replaces original contentNeeraj Singh2010-06-131-0/+6
| | | | | | [#4777 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Moved encoding work in progress to a feature branch."wycats2010-05-171-5/+5
| | | | This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
* Moved encoding work in progress to a feature branch.Jeremy Kemper2010-05-161-5/+5
| | | | This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
* Significantly improved internal encoding heuristics and support.wycats2010-05-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * Default Encoding.default_internal to UTF-8 * Eliminated the use of file-wide magic comments to coerce code evaluated inside the file * Read templates as BINARY, use default_external or template-wide magic comments inside the Template to set the initial encoding * This means that template handlers in Ruby 1.9 will receive Strings encoded in default_internal (UTF-8 by default) * Create a better Exception for encoding issues, and use it when the template source has bytes that are not compatible with the specified encoding * Allow template handlers to opt-into handling BINARY. If they do so, they need to do some of their own manual encoding work * Added a "Configuration Gotchas" section to the intro Rails Guide instructing users to use UTF-8 for everything * Use config.encoding= in Ruby 1.8, and raise if a value that is an invalid $KCODE value is used Also: * Fixed a few tests that were assert() rather than assert_equal() and were caught by Minitest requiring a String for the message * Fixed a test where an assert_select was misformed, also caught by Minitest being more restrictive * Fixed a test where a Rack response was returning a String rather than an Enumerable
* Use annoted source code in Template:Error to avoid special cases in the show ↵José Valim2010-05-091-0/+1
| | | | exceptions middleware.
* Expect an incompatible encoding exception when a template with a magic ↵Jeremy Kemper2010-04-081-2/+13
| | | | comment renders a partial without one and its source encoding doesn't match the default external encoding
* Expect an incompatible encoding exception when a template doesn't have a ↵Jeremy Kemper2010-04-081-25/+36
| | | | magic comment and its source encoding doesn't match the default external encoding
* Fix memory leak in dev modewycats2010-04-021-0/+8
|
* All tests pass without memoizing view_contextCarlhuda2010-03-181-1/+1
|
* Add deprecation notices for <% %>.Carlhuda2010-03-151-0/+8
| | | | | | | | | | | | | | | | * The approach is to compile <% %> into a method call that checks whether the value returned from a block is a String. If it is, it concats to the buffer and prints a deprecation warning. * <%= %> uses exactly the same logic to compile the template, which first checks to see whether it's compiling a block. * This should have no impact on other uses of block in templates. For instance, in <% [1,2,3].each do |i| %><%= i %><% end %>, the call to each returns an Array, not a String, so the result is not concatenated * In two cases (#capture and #cache), a String can be returned that should *never* be concatenated. We have temporarily created a String subclass called NonConcattingString which behaves (and is serialized) identically to String, but is not concatenated by the code that handles deprecated <% %> block helpers. Once we remove support for <% %> block helpers, we can remove NonConcattingString.
* Optimize and clean up how details key get expired.José Valim2010-03-101-4/+4
|
* Speed up performance in resolvers by adding fallbacks just when required.José Valim2010-03-081-3/+3
|
* Solved a problem that prevented render :file => work in layoutsJose Fernandez2010-03-051-0/+5
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Fix some tests that relied on hardcoded Exception information (ht: evan)Yehuda Katz2010-03-021-2/+2
|
* Reorganize autoloads:Carlhuda2009-12-021-4/+4
| | | | | | | | | | | | | | | | | | | | | * A new module (ActiveSupport::Autoload) is provide that extends autoloading with new behavior. * All autoloads in modules that have extended ActiveSupport::Autoload will be eagerly required in threadsafe environments * Autoloads can optionally leave off the path if the path is the same as full_constant_name.underscore * It is possible to specify that a group of autoloads live under an additional path. For instance, all of ActionDispatch's middlewares are ActionDispatch::MiddlewareName, but they live under "action_dispatch/middlewares/middleware_name" * It is possible to specify that a group of autoloads are all found at the same path. For instance, a number of exceptions might all be declared there. * One consequence of this is that testing-related constants are not autoloaded. To get the testing helpers for a given component, require "component_name/test_case". For instance, "action_controller/test_case". * test_help.rb, which is automatically required by a Rails application's test helper, requires the test_case.rb for all active components, so this change will not be disruptive in existing or new applications.
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-081-1/+1
| | | | | | | | | | | | This consists of: * String#html_safe! a method to mark a string as 'safe' * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it * Calls to String#html_safe! throughout the rails helpers * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB) * New ERB implementation based on erubis which uses a SafeBuffer instead of a String Hat tip to Django for the inspiration.
* Ensure changes to I18n locale get reset during testsJoshua Peek2009-09-191-9/+5
|
* Got tests to pass with some more changes.Yehuda Katz2009-08-151-0/+2
| | | | | | | | | | | | | | | | * request.formats is much simpler now * For XHRs or Accept headers with a single item, we use the Accept header * For other requests, we use params[:format] or fallback to HTML * This is primarily to work around the fact that browsers provide completely broken Accept headers, so we have to whitelist the few cases we can specifically isolate and treat other requests as coming from the browser * For APIs, we can support single-item Accept headers, which disambiguates from the browsers * Requests to an action that only has an XML template from the browser will no longer find the template. This worked previously because most browsers provide a catch-all */*, but this was mostly accidental behavior. If you want to serve XML, either use the :xml format in links, or explicitly specify the XML template: render "template.xml".
* More cleanup of ActionView and reduction in need for blocks in some cases:Yehuda Katz2009-08-151-1/+1
| | | | | | | | * only one of partial_name or :as will be available as a local * `object` is removed * Simplify _layout_for in most cases. * Remove <% render :partial do |args| %> * <% render :partial do %> still works fine
* Clean up ActionView some:Yehuda Katz2009-08-151-11/+23
| | | | | | | | | | * Call _evaluate_assigns_and_ivars at the two entry points so we don't have to do a check at every render. * Make template.render viable without having to go through a wrapper method * Remove old TemplateHandler#render(template, local_assigns) path so we don't have to set self.template every time we render a template. * Move Template rescuing code to Template#render so it gets caught every time. * Pull in some tests from Pratik that test render @object in ActionView