Rails url

How do I get the url and its data in rails?

I've tried using open-uri:

@r = open("http://google.com/").read


This works for me in ruby

but not in rails.

If you can suggest a better way to get the url (if available), let me know!


source to share

1 answer

You need require 'open-uri'

to use open

for urls in Rails.



All Articles