Learn Ruby on Rails. The question arose.Whether it is possible to consider the contents of the external web page, parse it, and record the necessary data in the database?

0 like 0 dislike
5 views
As I understand it, this is the responsibility of any controller. But no ideas how to describe it.
by | 5 views

3 Answers

0 like 0 dislike
.
To parse a variety of ways. Most popular - nokogiri.

Usually such things are done in background tasks (ActiveJob) using, for example, services.
by
0 like 0 dislike
by
0 like 0 dislike
As I understand it, this is the responsibility of any controller.
No, the parsing of the page - long action, so using the controller you pass it to the model, the model puts the address in the queue, and the individual worker will have to parse.
by
110,608 questions
257,186 answers
0 comments
28,741 users