Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created September 14, 2008 22:59
Show Gist options
  • Save carllerche/10776 to your computer and use it in GitHub Desktop.
Save carllerche/10776 to your computer and use it in GitHub Desktop.
How do we generate the following?
From inside a slice, generate a route that stays inside the slice.
From inside a slice, generate a route that goes to another slice.
From inside a slice, generate a route that goes to the main application.
From the main application, generate a route to a slice route.
ForumSlice::Router.prepare do
resources :posts
end
Merb::Router.prepare do
namespace :awesome
slice :forum
end
end
# --- In slices/forum/home or whatever...
url(:posts) # => /awesome/forum/posts
# --- in main application
url(:awesome_forum_posts) # => /awesome/forum/posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment