Hey Adam,

That’s already possible. See the Collection Caching section here: 
https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache
 
<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 <adamstockl...@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-core+unsubscr...@googlegroups.com 
> <mailto:rubyonrails-core+unsubscr...@googlegroups.com>.
> To post to this group, send email to rubyonrails-core@googlegroups.com 
> <mailto:rubyonrails-core@googlegroups.com>.
> Visit this group at https://groups.google.com/group/rubyonrails-core 
> <https://groups.google.com/group/rubyonrails-core>.
> For more options, visit https://groups.google.com/d/optout 
> <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.

Reply via email to