Are unobtrusive RJS files in Rails 3 considered a good idea?

I am working on implementing javascript functions in my rails 3 application. Now that rjs is supposedly unobtrusive (I honestly don't know much about rjs), is it really “evil”?

It seems to me that the lack of testability may be a drawback, but partial page updates via rjs seem easier than jumping over rail obstacles to make ajax requests through jquery.

Thoughts? Examples?

+3
source share
1 answer

rjs is not evil as such (unless you are considering a prototype of evil, which is a valid point of view), it is more than one of those things that cannot be used without realizing what does it under the hood. You should not use rjs to avoid learning javascript, and once you learn javascript, you naturally tend to js.erb files. page.refresh is actually pretty much the only thing I use rjs files for more.

Out of curiosity, what kind of hoops do you jump to make Ajax requests?

+4
source

Source: https://habr.com/ru/post/1748072/


All Articles