Answers for "ruby get url path"

3

rails get current path

request.url
# => "http://localhost:3000/lists/7/items"
request.path
# => "/lists/7/items"
Posted by: Guest on April-14-2020
0

Open Url in ruby

require 'open-uri'

url = 'https://www.website.com'

puts open(url).read # => Content of the webpage

puts open(url).read.class # => String
Posted by: Guest on September-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language