Created
April 11, 2014 22:40
-
-
Save kitop/10507343 to your computer and use it in GitHub Desktop.
nested routes
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
Cuba.define do | |
on "posts" do | |
run Posts | |
end | |
end | |
class Posts < Cuba | |
define do | |
on ":id" do |id| | |
post = Post[id] | |
# some methods | |
on "comments" do | |
run Comments | |
end | |
end | |
end | |
end | |
class Comments < Cuba | |
define do | |
# some routes | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment