I would love to contribute. So when you said move Collection caching section to render, did you mean to move out the method `cache` from `cache_helper` to `render_helper`? Or do we need to just move the documentation to render method about collection caching?
Collection caching is also mentioned here https://guides.rubyonrails.org/caching_with_rails.html#collection-caching . Do we need to add `cached: block` here? On Friday, March 22, 2019 at 10:54:13 PM UTC+5:30, Kasper Timm Hansen wrote: > > Glad to hear it! > > I just realized we should probably move that section to the render method > instead. Since that’s where the option is. > > So there’s a free PR there for anyone who’s interested! > > -- > Kasper > On 22 Mar 2019, 18.20 +0100, Adam Stockland <adamst...@gmail.com > <javascript:>>, wrote: > > How did I miss that??!! I must have read through those docs a million > times. Thank you so much for posting. > > On Friday, March 22, 2019 at 8:11:57 AM UTC-6, Kasper Timm Hansen wrote: >> >> Hey Adam, >> >> That’s already possible. See the Collection Caching section here: >> https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache >> >> <%= render partial: 'projects/project', collection: @projects, cached: -> >> project { [ project, current_user ] } %> >> >> >> -- >> Kasper >> >> On 15 Mar 2019, at 22.48, Adam Stockland <adamst...@gmail.com> wrote: >> >> Not sure if this is a quality idea, or not. When rendering a collection, >> could a custom cache key be generated using the object and any locals being >> passed? >> Example: including current_user in the collection cache key >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-co...@googlegroups.com. >> To post to this group, send email to rubyonra...@googlegroups.com. >> Visit this group at https://groups.google.com/group/rubyonrails-core. >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-co...@googlegroups.com <javascript:>. > To post to this group, send email to rubyonra...@googlegroups.com > <javascript:>. > Visit this group at https://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.