<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Module: ActionController::Routing::Optimisation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Module</strong></td> <td class="class-name-in-header">ActionController::Routing::Optimisation</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../../../files/lib/action_controller/routing/optimisations_rb.html"> lib/action_controller/routing/optimisations.rb </a> <br /> </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="description"> <p> Much of the slow performance from routes comes from the complexity of expiry, <tt>:requirements</tt> matching, defaults providing and figuring out which url pattern to use. With named routes we can avoid the expense of finding the right route. So if they‘ve provided the right number of arguments, and have no <tt>:requirements</tt>, we can just build up a string and return it. </p> <p> To support building optimisations for other common cases, the generation code is separated into several classes </p> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000189">generate_optimisation_block</a> </div> </div> </div> <!-- if includes --> <div id="section"> <div id="class-list"> <h3 class="section-bar">Classes and Modules</h3> Class <a href="Optimisation/Optimiser.html" class="link">ActionController::Routing::Optimisation::Optimiser</a><br /> Class <a href="Optimisation/PositionalArguments.html" class="link">ActionController::Routing::Optimisation::PositionalArguments</a><br /> Class <a href="Optimisation/PositionalArgumentsWithAdditionalParams.html" class="link">ActionController::Routing::Optimisation::PositionalArgumentsWithAdditionalParams</a><br /> </div> <div id="constants-list"> <h3 class="section-bar">Constants</h3> <div class="name-list"> <table summary="Constants"> <tr class="top-aligned-row context-row"> <td class="context-item-name">OPTIMISERS</td> <td>=</td> <td class="context-item-value">[PositionalArguments, PositionalArgumentsWithAdditionalParams]</td> </tr> </table> </div> </div> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000189" class="method-detail"> <a name="M000189"></a> <div class="method-heading"> <a href="Optimisation.src/M000189.html" target="Code" class="method-signature" onclick="popupCode('Optimisation.src/M000189.html');return false;"> <span class="method-name">generate_optimisation_block</span><span class="method-args">(route, kind)</span> </a> </div> <div class="method-description"> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>