…String [#4247 state:resolved]
Set config.action_controller.asset_path_template to a proc that takes one argument - the direct, unchanged asset path - and returns a path to that asset using the scheme that your assets require. This is useful if you have a setup which scales by introducing new application servers where the mtime of the asset files may not be the same as those of the asset files on your previous servers, but it does require your web servers to have knowledge of the asset template paths that you rewrite to so it's not suitable for out-of-the-box use. An example of configuring asset path generation and rewriting these paths using Apache is included in actionpack/lib/action_view/helpers/asset_tag_helper.rb. Signed-off-by: wycats <firstname.lastname@example.org>
The example provided contrived. It is not useful when wanting to use 1-based asset hosts (since it would generate a random asset host for the same asset). Signed-off-by: Rizwan Reza <email@example.com>
[#4232 state:committed] Signed-off-by: Jeremy Kemper <firstname.lastname@example.org>
…troller::Base.perform_caching Signed-off-by: José Valim <email@example.com>
[#2837 state:committed] Signed-off-by: Jeremy Kemper <firstname.lastname@example.org>
…ctController configuration refactor.
…. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
This reverts commit 8a46e11.
By using config rather than hardcoded constants, we can evolve the configuration system over time (we'd just need to update the config method with more robust capabilities and all consumers would get the capabilities with no code changes)
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.
…et_link_tag sources unless the :cache or :concat options are given. [#2738 state:resolved] Signed-off-by: Joshua Peek <email@example.com>
…".js" or ".css" onto external urls [#1664 state:resolved] Signed-off-by: Pratik Naik <firstname.lastname@example.org>
…cording to the specs. Added all boolean attributes listed in the XHTML 1.0 specs (http://www.w3.org/TR/xhtml1/guidelines.html) and HTML 5 specs (http://www.whatwg.org/specs/web-apps/current-work). HTML 5 boolean attribute rendering was broken in commit 1e2d722 / [#2864 state:resolved]. Signed-off-by: Yehuda Katz <email@example.com>
…s. HTML attributes values should be true or false not attribute's name. [#2864 state:resolved] Signed-off-by: Yehuda Katz <firstname.lastname@example.org>
…mage_tag works) (tests included); removes a duplicate test line for image_tag; adds boolean attributes for video tag to tag()'s boolean attributes Signed-off-by: Yehuda Katz + Carl Lerche <email@example.com>
This is useful for working around IE's stylesheet limit. stylesheet_link_tag :all, :concat => true
Signed-off-by: Michael Koziarski <firstname.lastname@example.org>
…1879 state:resolved] Signed-off-by: Joshua Peek <email@example.com>
… of the cache key instead of just assuming the its a string [#1299 state:committed]
…or the asset host Signed-off-by: Michael Koziarski <firstname.lastname@example.org> [#1394 state:committed]
…ults for different given sources [#1471 state:resolved] Signed-off-by: Joshua Peek <email@example.com>
…to call (see http://github.com/dhh/asset-hosting-with-minimum-ssl for an example) [DHH]