Class | Merb::Router |
In: |
lib/merb-core/dispatch/router/behavior.rb
lib/merb-core/dispatch/router/cached_proc.rb lib/merb-core/dispatch/router/route.rb lib/merb-core/dispatch/router.rb |
Parent: | Object |
SEGMENT_REGEXP | = | /(:([a-z_][a-z0-9_]*|:))/ |
SEGMENT_REGEXP_WITH_BRACKETS | = | /(:[a-z_]+)(\[(\d+)\])?/ |
JUST_BRACKETS | = | /\[(\d+)\]/ |
PARENTHETICAL_SEGMENT_STRING | = | "([^\/.,;?]+)".freeze |
Appends the generated routes to the current routes.
&block: | A block that generates new routes when yielded a new Behavior. |
Generates a URL based on passed options.
name<~to_sym, Hash>: | The name of the route to generate. |
params<Hash>: | The params to use in the route generation. |
fallback<Hash>: | Parameters for generating a fallback URL. |
String: | The generated URL. |
If name is a hash, it will be merged with params and passed on to generate_for_default_route along with fallback.
Generates a URL based on the default route scheme of "/:controller/:action/:id.:format".
params<Hash>: | The primary parameters to create the route from (see below). |
fallback<Hash>: | Fallback parameters. Same options as params. |
:controller<~to_s>: | The controller name. Required. |
:action<~to_s>: | The action name. Required. |
:id<~to_s>: | The ID for use in the action. |
:format<~to_s>: | The format of the preferred response. |
String: | The generated URL. |
Prepares new routes and adds them to existing routes.
first<Array>: | An array of routes to add before the generated routes. |
last<Array>: | An array of routes to add after the generated routes. |
&block: | A block that generates new routes. |
new_behavior<Behavior>: | Behavior for child routes. |
Prepends the generated routes to the current routes.
&block: | A block that generates new routes when yielded a new Behavior. |