-
-
Save fabien/10896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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