I have a section of a page that needs to update based on certain
events. I use Ajax to do that updating. But on first loading the page,
that section needs to be populated. I’ve read the way to do this is
with partials. With partials, you can use the same method to create
the initial content and to do the Ajax update. Another way is to
simply make an Ajax call when the page first loads.
My question is which of these methods is better or is it a personal
preference?
I have a section of a page that needs to update based on certain
events. I use Ajax to do that updating. But on first loading the page,
that section needs to be populated. I’ve read the way to do this is
with partials. With partials, you can use the same method to create
the initial content and to do the Ajax update. Another way is to
simply make an Ajax call when the page first loads.
My question is which of these methods is better or is it a personal
preference?
The partial saves a second hit on your app.
–
We develop, watch us RoR, in numbers too big to ignore.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.