Is unobtrusive RJS files in Rails 3 considered a good idea?
I'm working on implementing javascript functionality in my rails 3 app. Now that rjs is supposedly unobtrusive (I honestly don't know a lot about rjs), is it still "ev开发者_运维技巧il"?
It seems to me the downside may be a lack of testability, but partial page updates via rjs seem to be easier than jumping through the rails hurdles to make ajax requests via jquery.
Thoughts? Examples?
rjs isn't evil per se (unless you consider prototype evil, which is a valid point of view), its more one of those things that shouldn't be used without understanding what its doing under the hood. You shouldn't use rjs as a way to avoid learning javascript, and once you learn javascript you tend to naturally lean towards js.erb files anyways. page.refresh is actually pretty much the only thing I use rjs files for anymore.
Out of curiosity, what hoops are you jumping through to do Ajax requests?
精彩评论