How do I - in Rails - receive a get request from one website (url), then save the parameters, and generate a new url of another website, with other parameters (calculated/ from db), and redirect to it?
I have no problem with the steps in the middle (e.g. saving to db, receiving parameters). The main question is how do I receive a get request, AND send a get request in Rails.
I saw according to the following question: How make a HTTP request using Ruby on Rails? that I can use the Net::HTTP
class. However it seems there that they focus on requesting from another website some data, while here we are receiving hits from some website and want to redirect to another one.
My question is: 1. How do I save as a variable the url that the person arrived from (there is a paramater I need from there)? 2. How do I redirect the user to the new url at the end of the steps (saving, parsing new url, etc)? 3. Where do I perform these two main actions? In the controller? That is my instinct, however, doesn't the view hold the relevant url? where is the relevant index url people are referring to?