RailsCasts Pro episodes are now free!

Learn more or hide this

Denny's Profile

GitHub User: dennybritz

Site: http://dennybritz.com

Comments by Denny

Avatar

I can't imagine this to be a feasible solutions for more complex applications or pages.

It's difficult to maintain. Just imagine you are using the same method on tens or hundreds of pages in your application. The javascript will get convoluted. You'd probably use different JS files for each page but that would force you to put all your user-specific code into partials, meaning you'd have hundreds of partial files lying around. It will be a mess.

Performance. Sure, as long as you are on localhost everything will be blazingly fast. However, once you are on a remote server and the pages are a bit more complex the user will inevitably experience delays before the elements pop up. One should also consider the extra times it takes to render the partials, especially when rendering collections.

I am sure that there exist some scenarios where this approach is appropriate. For example, if you have a very large page with mainly static content. Still, for most cases, I think the drawbacks of this approach by far outweigh the benefits and that action or fragement caching would probably a better solution.