14 Jul '12, 7pm

@fladdict つ Fragment Caching Railsでテンプレートを2段階にする方法ってないのかな、中間テンプレートというか。 「ホットエントリ」みたいのをテンプレートとしてキャッシュしてから

class ProductSweeper < ActionController::Caching::Sweeper observe Product # This sweeper is going to keep an eye on the Product model # If our sweeper detects that a Product was created call this def after_create(product) expire_cache_for(product) end # If our sweeper detects that a Product was updated call this def after_update(product) expire_cache_for(product) end # If our sweeper detects that a Product was deleted call this def after_destroy(product) expire_cache_for(product) end private def expire_cache_for(product) # Expire the index page now that we added a new product expire_page(:controller => 'products', :action => 'index') # Expire a fragment expire_fragment('all_available_products') end end

Full article: http://guides.rubyonrails.org/caching_with_rails.html#fra...

Tweets

@robotmay my guess is you can do something alon...

guides.rubyonrails.org 14 Jul '12, 3pm

To find the current layout, Rails first looks for a file in app/views/layouts with the same base name as the controller. F...

What’s New in Edge Rails #29: Week of July 9 – ...

afreshcup.com 16 Jul '12, 12pm

is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the univer...