0
I Use This!
Activity Not Available

Project Summary

This plugin no longer works with Rails 2.1 and has subsequently been discontinued.

As an alternative, try placing this in application.rb:

helper_method :read_fragment_or_cache
def read_fragment_or_cache(opts)
#puts "read_fragment_or_cahce called. opts = #{opts.inspect}"
# Check to see if key has expired
return nil unless opts[:key]
key = opts[:key]
expire_at = opts[:expire_at] || Time.now
fragment = Rails.cache.read(key, :raw => true)
#fragment = read_fragment(key, {:expire_at => expire_at})
if fragment.nil?
puts "\n\n Fragment NOT FOUND for key: #{key}\n"
# Render whatever should be rendered by the render options to a string for caching.
fragment = render_to_string(opts[:render])
Rails.cache.write(key, fragment, :raw => true)
#result = write_fragment(opts[:key], fragment)
else
puts "\n\n Fragment WAS INDEED found for key: #{key}\n"
end
return fragment
endThen you can define cache helper methods (in application.rb, for example) like:

helper_method :cached_popular_this_week
def cached_popular_this_week
fragment = read_fragment_or_cache :key => "home/popular_this_week",
:expire_at => 1.hour.ago,
:render => {:partial => "shared/popular_this_week"}
return fragment
endAnd simply call them in your views with:

There might be better ways to do all this. Hopefully this is of some help though if you are migrating to Rails 2.1 and beyond.

Tags

filestores fragmentcaching plugins rails ror ruby

In a Nutshell, dynamic-file-store...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

MIT License
Permitted

Commercial Use

Modify

Distribute

Sub-License

Private Use

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    use of OSS increased in 65% of companies in 2016
  • ...
    anyone with an Open Hub account can update a project's tags
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    learn about Open Hub updates and features on the Open Hub blog

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis