Support for fragment caching helper #22

Closed
sidbatra opened this Issue Feb 11, 2012 · 9 comments

Comments

Projects
None yet
8 participants

Functionality similar to the fragment caching helper method in erb templates - <%cache @key do%> <%end%>

Additionally, if the entire output of the JBuilder template is to be cached under one key the first line of the template can specify the key - cache @key

cmer commented Mar 8, 2012

+1

sidbatra commented Mar 9, 2012

Also see related discussion about the rabl gem nesquena/rabl#143

nc commented Mar 26, 2012

+1

cmer commented Mar 27, 2012

Until proper caching is implemented, I created my own dirty hacky workaround. https://gist.github.com/2221345

nc commented Mar 27, 2012

If it helps anyone, here's another (dirty) workaround nc/jbuilder@88d5413

It adds dependencies on Rails.cache, and yajl and only works for collections 1 level deep. Need I mention that YMMV?

maletor commented Apr 16, 2012

👍

keighl commented Jun 27, 2012

An easy workaround: http://keighl.com/post/fragment-caching-with-jbuilder. Move jbuilder templates into partials that are rendered within something that does support fragment caching like ERB or HAML.

s12chung commented Sep 9, 2012

+1

Contributor

rgarver commented Sep 26, 2012

I think this was closed by 736f553 and 3a7a846. Further wrap up with #67.

@dhh dhh closed this Sep 26, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment