In Rails controller, I’d like to validate a user-inputted URL (say, it’s in a variable url) by making a request to it, and checking that the response is not 50X. How can I do that?
In Rails controller, I’d like to validate a user-inputted URL (say, it’s in a
Share
You can send request from a controller using
Net::Httpmodule as follows