Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Mymodulesnamespace
- module ApplicationHelper
- def method_missing method, *args, &block
- puts "LOOKING FOR ROUTES #{method}"
- if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
- if main_app.respond_to?(method)
- main_app.send(method, *args)
- else
- super
- end
- else
- super
- end
- end
- def respond_to?(method)
- if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
- if main_app.respond_to?(method)
- true
- else
- super
- end
- else
- super
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement