Reputation: 56749
For some 'minor' actions in my site, I'm using remote
instead of standard HTML requests. My current remote
technique is like this:
form_for
or form_tag
with :remote => true
.In the controller action, do:
respond_to do |format|
format.js
end
Then create a .js.erb
file that loads a partial / creates a flash message / highlights parts of the page, etc.
I want to understand the implications of my approach because I don't want my own ignorance to lead to problems I don't know about.
Upvotes: 1
Views: 67
Reputation: 115541
It doesn't lead to more browser issues than usual js
I'd say it's the current way for low traffic or few actions (like admin reserved area)
Using this technique leads to more server work than basic ajax returning json handled fully client-side.
Upvotes: 1