Deb Lewis
2006-Jul-05 05:59 UTC
[Masterview-devel] Proposed name/structure of config setting for asset path refs
Jeff - ok, here''s a proposal for config settings to specify how to identify the design-time directory ref prefix on image/stylesheet/js assets. Config setting name ''template_asset_base_ref_pattern'', structured as a hash with keys :images, :stylesheets, and :javascripts per the standard naming convention in rails public dir for these assets. The defaults for these are your xxx_SRC_EXTRACT_REGEX''s in the asset helper directives that match ugly rel refs up from app/views to rails public dir (../../../public/stylesheets/xxx.css) I like one config setting with hash entries rather than proliferating a trio of new settings names. Partly because I think we may need a matching config setting for handling customization of the dir names in the public dir, but I need to revisit that area of rails first to review the mechanics - you can if you choose rename your public/stylesheets dir to, say, public/styles. See javadoc below; will add this to the config doc and settings example/gen-templates after names are settled on. ~ Deb ---------------------------------------------------- template_asset_base_ref_pattern Regex pattern specifications for identifying the base directory on asset references in a template document to convert design-time assert references for images, stylesheets, and javascript files into relative references for use with the standard Rails asset helper functions. Asset types are :images, :stylesheets, :javascripts The standard patterns match path prefixes up through public/asset-type. For example, an mv:stylesheet_link directive of the form: <link rel="stylesheet" type="text/css" href="../../../public/stylesheets/mystyles.css" mv:stylesheet_link="" /> would match the standard base-dir prefix and result in: <%= stylesheet_link_tag "mystyles" %> ----------------------------------------------------