Created
October 13, 2008 11:25
-
-
Save lukesutton/16521 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
# This allows users to publish the path to the public pages | |
Merb::Router.extensions do | |
def gluttonberg_pages(prefix = nil) | |
path = prefix ? "/#{prefix}/:path" : "/:path" | |
match(path, :path => /\S+/). | |
to(:controller => "gluttonberg/content/public", :action => "show"). | |
name(:gluttonberg_public_page) | |
end | |
end |
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
scope.identify DataMapper::Resource => :id do |s| | |
# Controllers in the content module | |
s.match("/content").to(:controller => "content/main").name(:content) | |
s.match("/content") do |c| | |
c.resources(:pages, :controller => "content/pages") do |p| | |
p.match("/localizations/:id").to(:controller => "content/page_localizations") do |l| | |
l.match("/edit").to(:action => "edit").name(:edit_localization) | |
l.match(:method => "put").to(:action => "update") | |
end.name(:localization) | |
end | |
c.resources(:templates, :controller => "content/templates") do |t| | |
t.resources(:sections, :controller => "content/template_sections") | |
end | |
end | |
# Top level controllers | |
s.resources(:locales) | |
s.resources(:dialects) | |
# Asset Library | |
s.match("/library").to(:controller => "library/main").name(:library) | |
s.match("/library") do |a| | |
a.resources(:assets, :controller => "library/assets") | |
a.resources(:collections, :controller => "library/collections") | |
end | |
# Users | |
s.match("/users").to(:controller => "users").name(:users) | |
# Settings | |
s.match("/settings").to(:controller => "settings").name(:settings) | |
s.gluttonberg_pages("public") if Gluttonberg.standalone? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment