3
I have noticed that in every page/route exchange, the Rails *make a new request Ajax to search for this new data (HTML), and thus perform the page exchange. I did several searches but the closest I arrived was in relation to the Embedded Ruby
(erb).
If this is really valid, I would like to know how and with what the Rails makes this exchange, and what are the options and advantages of using this type of resource, for example:
- I have the availability of the
two-way data binding
also? - What resources are available?
- I have other options?
Details
The question can be confusing so I decided to add some images that show what I really want to understand. Using a simple navigation bar with links (element a) for route change, as shown in figure 1.
Figure 1: The navigation menu I used for the tests.
I can notice that Rails makes some requests to exchange these pages (such as Angularjs or vuejs), as shown in image 2.
Figure 2: The results of page/route changes in the console tab.
We can also follow the tab network
, as shown in Figure 3.
Figure 3: The results of page/route changes in the network tab.
Thank you.
Excellent! As I’m following a book to learn Rails, I couldn’t identify this feature, which, it was very clear after your reply and the images that I added the question myself. Thank you, have a good development day.
– Rafael Berro
@Rafaelberro really, after placing the images I was able to identify what was really happening. Good development.
– Luiz Carvalho