Skip to content

Dynamic partial name for cache in Rails 4? #30

@netwire88

Description

@netwire88

With Rails 3 + Cache Digest + multi_fetch_fragments, I was able to do this:

=render partial: 'groups/group', collection: @results, as: :result, cache: true
And `groups/group` partial can support dynamic partial names, like this:
=render partial: "#{group.name}/#{group.name}", locals: {result: user}

However, after upgrading to Rails 4, I'm getting lots of Couldn't find template for digesting: "#{group.name}/#{group.name}" errors. I also tried:

- # Template Dependency: "#{group.name}/#{group.name}"
=render partial: "#{group.name}/#{group.name}", locals: {result: user}

But that's not working. Is this still supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions