-
-
Save copiousfreetime/74eea8d50a666c4b8122 to your computer and use it in GitHub Desktop.
mult_route roda app
This file contains hidden or 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
class A < ::Roda | |
def do_a_thing | |
# ... | |
end | |
# route('a') do |r| -- doesn't work | |
::App.route('a') do |r| | |
r.get 'thing' do | |
do_a_thing # Method not Found | |
end | |
end | |
end |
This file contains hidden or 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
class App < ::Roda | |
plugin :multi_route | |
require './a' | |
require './b' | |
route do |r| | |
r.on 'a' do | |
r.multi_route('a') | |
end | |
r.on 'b' do | |
r.multi_route('b') | |
end | |
end | |
end | |
end |
This file contains hidden or 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
class B < ::Roda | |
def do_b_stuff | |
# ... | |
end | |
# route('b') do |r| -- doesn't work | |
::App.route('b') do |r| | |
r.get 'stuff' do | |
do_b_stuff # Method not found | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment