Guest User

Untitled

a guest
May 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. # Merb::Router is the request routing mapper for the merb framework.
  2. #
  3. # You can route a specific URL to a controller / action pair:
  4. #
  5. # match("/contact").
  6. # to(:controller => "info", :action => "contact")
  7. #
  8. # You can define placeholder parts of the url with the :symbol notation. These
  9. # placeholders will be available in the params hash of your controllers. For example:
  10. #
  11. # match("/books/:book_id/:action").
  12. # to(:controller => "books")
  13. #
  14. # Or, use placeholders in the "to" results for more complicated routing, e.g.:
  15. #
  16. # match("/admin/:module/:controller/:action/:id").
  17. # to(:controller => ":module/:controller")
  18. #
  19. # You can specify conditions on the placeholder by passing a hash as the second
  20. # argument of "match"
  21. #
  22. # match("/registration/:course_name", :course_name => /^[a-z]{3,5}-\d{5}$/).
  23. # to(:controller => "registration")
  24. #
  25. # You can also use regular expressions, deferred routes, and many other options.
  26. # See merb/specs/merb/router.rb for a fairly complete usage sample.
  27.  
  28. Merb.logger.info("Compiling routes...")
  29. Merb::Router.prepare do
  30. resources :articles
  31. # RESTful routes
  32. # resources :posts
  33.  
  34. # Adds the required routes for merb-auth using the password slice
  35. slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
  36.  
  37. # This is the default route for /:controller/:action/:id
  38. # This is fine for most cases. If you're heavily using resource-based
  39. # routes, you may want to comment/remove this line to prevent
  40. # clients from calling your create or destroy actions with a GET
  41. default_routes
  42.  
  43. # Change this for your home page to be available at /
  44. # match('/').to(:controller => 'whatever', :action =>'index')
  45. end
Add Comment
Please, Sign In to add comment