Method: Espresso::View::InstanceMethods#overwrite_url

Defined in:
lib/espresso/view.rb

#overwrite_url(overwrites, options = {}) ⇒ String

Overwrites current url. By default uses full path (with host), if it is not overwrited in options

Parameters:

  • overwrites (Hash)

    hash of params to overwrite

  • options (Hash) (defaults to: {})

    hash of options to url_for

Returns:

  • (String)

    overwrited url



44
45
46
47
48
49
# File 'lib/espresso/view.rb', line 44

def overwrite_url(overwrites, options = {})
  overwrites ||= {}
  options ||= {}
  options[:only_path] = false unless options.key?(:only_path)
  url_for({:overwrite_params => (overwrites || {})}.merge(options))
end