aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'mainstream/master'Pratik Naik2009-09-308-104/+215
|\
| * Ported the new ActionView::TestCase from 2-3-stable to master [#3260Erik Ostrom2009-09-282-25/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state:resolved] The test case now mimicks the template environment more closely, so it's possible to use render, load helper dependencies. This also fixes assert_select, and similar assertions. Because view tests and helpers generally don't render full templates assert_select looks first in rendered and then in output_buffer to find the rendered output. Additional `master'-only changes: Made the Action Pack Rakefile run the ActionView::TestCase tests, and made ActionView::Rendering#_render_text always return a string. Signed-off-by: Joshua Peek <josh@joshpeek.com>
| * Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 ↵John Trupiano2009-09-282-10/+22
| | | | | | | | | | | | | | days return '2 days'. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3266 state:committed]
| * Enhancing distance_of_time_in_words to prefix year output with over and ↵Jay Pignata2009-09-281-4/+7
| | | | | | | | | | | | | | about depending upon how many months have elapsed Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3106 state:committed]
| * Restore split between require-time and runtime load path mungery. Simplifies ↵Jeremy Kemper2009-09-241-1/+1
| | | | | | | | vendor requires.
| * Clean up log output for rendered templatesJoshua Peek2009-09-244-67/+87
| |
* | Merge commit 'mainstream/master'Pratik Naik2009-09-2110-232/+129
|\|
| * Instrument process_action, render and sql.José Valim2009-09-201-2/+4
| |
| * Remove unused code in ActionView.José Valim2009-09-153-130/+0
| | | | | | | | Signed-off-by: Yehuda Katz <wycats@gmail.com>
| * Rollback AS bundler work and improve activation of vendored dependenciesJoshua Peek2009-09-131-1/+1
| |
| * AV::UrlHelper depends on Array#secondJoshua Peek2009-09-131-0/+1
| |
| * Don't force test suite to use bundlerJoshua Peek2009-09-131-0/+1
| |
| * Allow fields_for on a nested_attributes association to accept an explicit ↵Andrew France2009-09-121-7/+19
| | | | | | | | | | | | collection to be used. [#2648 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
| * Clean tag attributes before passing through the escape_once logic.Michael Koziarski2009-09-041-1/+1
| | | | | | | | Addresses CVE-2009-3009
| * Replace :formats => ["*/*"] with the default formats setYehuda Katz + Carl Lerche2009-09-031-0/+2
| |
| * Don't raise exceptions for missing javascript_include_tag or ↵Sam Pohlenz2009-09-031-2/+6
| | | | | | | | | | | | stylesheet_link_tag sources unless the :cache or :concat options are given. [#2738 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
| * Refactor ActionView::ResolverYehuda Katz + Carl Lerche2009-09-031-77/+95
| |
| * Fix the */* with Net::HTTP bug [#3100 state:resolved]Yehuda Katz + Carl Lerche2009-09-011-22/+9
| |
* | Merge commit 'mainstream/master'Pratik Naik2009-08-3113-167/+278
|\|
| * Remove some old cruftYehuda Katz2009-08-271-3/+0
| |
| * Add a default parameter for Resolver#initializeCarl Lerche2009-08-261-1/+1
| |
| * I18n: use I18n for select helpers' prompt textAkira Matsuda2009-08-262-1/+6
| | | | | | | | | | | | [#2252 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Revert "I18n: use I18n for select helpers' prompt text"Jeremy Kemper2009-08-262-6/+1
| | | | | | | | | | | | | | | | Broke CI. [#2252 state:open] This reverts commit adedf72821a5623227ce91e6b298838e692477e4.
| * I18n: use I18n for select helpers' prompt textAkira Matsuda2009-08-262-1/+6
| | | | | | | | | | | | [#2252 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Fixes ActionMailer regression [#3059 state:resolved]Yehuda Katz2009-08-151-1/+1
| |
| * Got tests to pass with some more changes.Yehuda Katz2009-08-153-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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".
| * Caches and cache clearing seems to actually work, but the actual ↵Yehuda Katz2009-08-152-50/+89
| | | | | | | | architecture is kind of messy. Next: CLEAN UP.
| * More cleanup of ActionView and reduction in need for blocks in some cases:Yehuda Katz2009-08-154-29/+11
| | | | | | | | | | | | | | | | * 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-155-64/+33
| | | | | | | | | | | | | | | | | | | | * 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
| * More perf work:Yehuda Katz2009-08-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move #set_cookie and #delete_cookie inline to optimize. These optimizations should almost certainly be sent back upstream to Rack. The optimization involves using an ivar for cookies instead of indexing into the headers each time. * Was able to use a bare Hash for headers now that cookies have their own joining semantics (some code assumed that the raw cookies were an Array). * Cache blankness of body on body= * Improve expand_cache_key for Arrays of a single element (common in our case) * Use a simple layout condition check unless conditions are used * Cache visible actions * Lazily load the UrlRewriter * Make etag an ivar that is set on prepare!
| * Tentatively accept the ":as or :object, but not both" solutionYehuda Katz2009-08-111-22/+21
| |
| * Further experimentation. Was able to cut the cost of rendering 100 partials ↵Yehuda Katz2009-08-112-18/+51
| | | | | | | | | | | | | | | | | | | | in a collection in half. To discuss: What are the desired semantics (if any) for layouts in a collection. There are no tests for it at present, and I'm not sure if it's needed at all. Deprecated on this branch: `object` pointing at the current object in partials. You can still use the partial name, or use :as to achieve the same thing. This is obviously up for discussion.
| * Add some more caching to the lookupYehuda Katz2009-08-111-12/+18
| |
| * This change causes some failing tests, but it should be possible to make ↵Yehuda Katz2009-08-111-2/+4
| | | | | | | | them pass with minimal performance impact.
| * Introduce grouped_collection_select helper.codeape2009-08-091-0/+67
| | | | | | | | | | | | [#1249 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Make sure link_to generates the form with the specified :href if any [#2254 ↵Max Lapshin2009-08-101-1/+1
| | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Fixed to_label_tag to accept id attribute without changing for attribute ↵Matt Duncan2009-08-091-0/+1
| | | | | | | | | | | | [#2660 status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Add missing end ERB tag.Ryan Bigg2009-08-221-1/+1
|/
* Support passing Redcloth options via textilize helper [#2973 state:resolved]rizwanreza2009-08-091-3/+11
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Experimental: Improve performance of ActionView by preventing method cache ↵Yehuda Katz2009-08-091-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | flushing due to runtime Kernel#extend: * The helper module adds a new _helper_serial property onto AbstractController subclasses * When #helper is used to add helpers to a class, the serial number is updated * An ActionView subclass is created and cached based on this serial number. * That subclass includes the helper module from the controller * Subsequent requests using the same controller with the same serial will result in reusing that subclass, rather than being forced to take an action (like include or extend) that will result in a global method cache flush on MRI and a flush of the entire AV class' cache on JRuby. * For now, this optimization is not applied to the RJS helpers, which results in a global method cache flush in MRI and a flush of the JavaScriptGenerator class in JRuby only when using RJS. * Since the effects are limited to using RJS, and would only affect JavaScriptGenerator in JRuby (as opposed to the entire view object), it seems worthwhile to apply this now. * This resulted in a significant performance improvement. I will have benchmarks in the next day or two that show the performance impact of the last several commits. * There is a small chance this could break existing code (although I'm not sure how). If that happens, please report it immediately.
* Cache controller_path on the AV instance to avoid needing to make additional ↵Yehuda Katz2009-08-091-1/+3
| | | | calls back into the controller for each attempt (this was done because these calls were adding up significantly in partial rendering and showing up on profiles)
* Rendering a template from ActionView will default to looking for partials ↵Yehuda Katz2009-08-092-2/+4
| | | | | | | | | only in the current mime type. * The old behavior was tested only as a side-effect of a different test--the original tests remain; a new template in the XML mime was added. * If you are relying on the current behavior and object to this change, please participate in http://groups.google.com/group/rubyonrails-core/browse_thread/thread/6ef25f3c108389bd
* Cache some more things to improve partial perfYehuda Katz2009-08-092-5/+9
|
* Went from 25% slower partials (vs. 2.3) to 10% faster. More to come.Yehuda Katz2009-08-092-5/+9
|
* Clean up partial object some more; replace passing around a block to a ↵Yehuda Katz2009-08-091-35/+39
| | | | single block ivar
* Clean up initializer and some of the internals of PartialRendererYehuda Katz2009-08-092-49/+45
|
* Ruby 1.9 compat: can't implicitly set instance var using block argJeremy Kemper2009-08-081-2/+2
|
* Don't call additional methods on builders passed to the atom_feed helper.Michael Koziarski2009-08-091-1/+1
| | | | | | Additionally, actually test that the atom_feed helper works with :xml as an option. [#1836 state:committed]
* Update truncate documentation / examples to more clearly demonstrate its ↵Steve St. Martin2009-08-081-8/+10
| | | | | | | | actual behavior [#3016 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Allow content_tag options to take an array [#1741 state:resolved] ↵rizwanreza2009-08-081-9/+7
| | | | | | | | | | [rizwanreza, Nick Quaranto] Example: content_tag('p', "limelight", :class => ["song", "play"]) # => <p class="song play">limelight</p> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>