Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. module Mymodulesnamespace
  2. module ApplicationHelper
  3. def method_missing method, *args, &block
  4. puts "LOOKING FOR ROUTES #{method}"
  5. if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
  6. if main_app.respond_to?(method)
  7. main_app.send(method, *args)
  8. else
  9. super
  10. end
  11. else
  12. super
  13. end
  14. end
  15. def respond_to?(method)
  16. if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
  17. if main_app.respond_to?(method)
  18. true
  19. else
  20. super
  21. end
  22. else
  23. super
  24. end
  25. end
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement