Module: Vidibus::Helpers::Extensions::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/vidibus/helpers/extensions/controller.rb
Instance Method Summary collapse
-
#current_host ⇒ Object
Returns current hostname with protocol.
-
#current_url(options = {}) ⇒ Object
Returns the current url.
Instance Method Details
#current_host ⇒ Object
Returns current hostname with protocol.
12 13 14 |
# File 'lib/vidibus/helpers/extensions/controller.rb', line 12 def current_host @current_host ||= "#{request.protocol}#{request.host_with_port}" end |
#current_url(options = {}) ⇒ Object
Returns the current url. Provide :params => true to include request params.
18 19 20 21 |
# File 'lib/vidibus/helpers/extensions/controller.rb', line 18 def current_url( = {}) path = ([:params] == true) ? request.fullpath : request.path "#{current_host}#{path}" end |