Sha256: 01583a19f6e00edd7bbc1686a9f59fdb9b7eb222fcc1a4bc55bbf5d38897ecaf

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

# Merb::Router is the request routing mapper for the merb framework.
#
# You can route a specific URL to a controller / action pair:
#
#   match("/contact").
#     to(:controller => "info", :action => "contact")
#
# You can define placeholder parts of the url with the :symbol notation. These
# placeholders will be available in the params hash of your controllers. For example:
#
#   match("/books/:book_id/:action").
#     to(:controller => "books")
#
# Or, use placeholders in the "to" results for more complicated routing, e.g.:
#
#   match("/admin/:module/:controller/:action/:id").
#     to(:controller => ":module/:controller")
#
# You can specify conditions on the placeholder by passing a hash as the second
# argument of "match"
#
#   match("/registration/:course_name", :course_name => /^[a-z]{3,5}-\d{5}$/).
#     to(:controller => "registration")
#
# You can also use regular expressions, deferred routes, and many other options.
# See merb/specs/merb/router.rb for a fairly complete usage sample.

Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
  match("/").to(:controller => "testing", :action => "show_form")
  match("/internal_redirect").to(:controller => "testing", :action => "internal_redirect")
  match("/external_redirect").to(:controller => "testing", :action => "external_redirect")
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
davidtrogers-webrat-0.4.4.2 spec/integration/merb/config/router.rb
diabolo-webrat-0.4.4.1 spec/integration/merb/config/router.rb
diabolo-webrat-0.4.4.2 spec/integration/merb/config/router.rb
diabolo-webrat-0.4.4 spec/integration/merb/config/router.rb
raldred-webrat-0.4.4.2 spec/integration/merb/config/router.rb
sr-webrat-0.4.4.1 spec/integration/merb/config/router.rb