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!

+3


source to share


1 answer


You need require 'open-uri'

to use open

for urls in Rails.



+5


source







All Articles