Could also go with more of a rails convention and have...
<% cache_for(@record) do %> --> "user_45_cache" which would equate to
something like dom_id where it uses the types class and the object id
as part of the namespace.
The namespace param could be used as well and it would work similar to
dom_id as well where it appends to whatever the usual default is.
<% cache_for(@record, :namespace) do %> --> "user_45_cache_namespace"
Just some thoughts off the top of my head.
On Thu, Dec 4, 2008 at 12:23 PM, Alex MacCaw <[EMAIL PROTECTED]> wrote:
>
> Just wanted to run this by a few people to get some feedback.
>
> At the moment, fragment cache (as indeed Rails.cache) calls often look
> a bit like this:
> <% cache("[EMAIL PROTECTED]") do %>
>
> I was thinking cache should take multiple arguments, which would be
> joined with an underscore, like this:
> <% cache(:namespace, @record.id) do %>
>
> Looks a bit nicer. This wouldn't stop old cache calls (with a string)
> from working.
>
> What do you think?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---