Class: Excursion::Helpers::UrlHelper
- Inherits:
-
Object
- Object
- Excursion::Helpers::UrlHelper
- Defined in:
- lib/excursion/helpers/url_helper.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/excursion/helpers/url_helper.rb', line 10 def method_missing(meth, *args) if meth.to_s.match(/\A(#{routes.collect { |name,route| name }.join("|")})_(url|path)\Z/) ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper.create(routes.get($1.to_sym), @application.).call(Rails.application.routes, args) else super end end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
4 5 6 |
# File 'lib/excursion/helpers/url_helper.rb', line 4 def application @application end |
Instance Method Details
#routes ⇒ Object
6 7 8 |
# File 'lib/excursion/helpers/url_helper.rb', line 6 def routes @application.routes end |