Class: ActionDispatch::Routing::RouteSet
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::RouteSet
- Defined in:
- lib/rails/subdomain/url_for.rb
Instance Method Summary collapse
-
#url_for_with_subdomain(options = nil) ⇒ Object
Rails constructs subdomain-based routes correctly, but sometimes need a kick in the pants when generating a path and the route subdomain doesn’t match the current subdomain.
Instance Method Details
#url_for_with_subdomain(options = nil) ⇒ Object
Rails constructs subdomain-based routes correctly, but sometimes need a kick in the pants when generating a path and the route subdomain doesn’t match the current subdomain
7 8 9 10 11 12 13 |
# File 'lib/rails/subdomain/url_for.rb', line 7 def url_for_with_subdomain =nil if .kind_of? Hash and .has_key? :subdomain and [:_path_segments] and [:_path_segments][:subdomain] != [:subdomain] [:only_path] = false end url_for_without_subdomain end |