lib/volt/models/url.rb
# Full url rebuilds the url from it's constituent parts
Full url rebuilds the url from it's constituent parts
Full url rebuilds the url from it ' s constituent parts
def full_url
    if @port
      host_with_port = "#{@host}:#{@port}"
    else
      host_with_port = @host
    end
    path, params = @router.params_to_url(@params.deep_cur.to_h)
    new_url = "#{@scheme}://#{host_with_port}#{(path || @path).chomp('/')}"
    unless params.empty?
      new_url += '?'
      query_parts = []
      nested_params_hash(params).each_pair do |key,value|
        value = value.cur
        value = `encodeURI(value)`
        query_parts << "#{key}=#{value}"
      end
      new_url += query_parts.join('&')
    end
    new_url += '#' + @fragment if @fragment
    return new_url
  end
def full_url if @port host_with_port = "#{@host}:#{@port}" else host_with_port = @host end path , params = @router . params_to_url ( @params . deep_cur . to_h ) new_url = "#{@scheme}://#{host_with_port}#{(path || @path).chomp('/')}" unless params . empty? new_url += '?' query_parts = [ ] nested_params_hash ( params ) . each_pair do | key , value | value = value . cur value = ` encodeURI(value) ` query_parts << "#{key}=#{value}" end new_url += query_parts . join ( '&' ) end new_url += '#' + @fragment if @fragment return new_url end
Full url rebuilds the url from it's constituent parts
Full url rebuilds the url from it ' s constituent parts
# remove the _ from the front