Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page_cache_directory is not initialized or set from config #5

Closed
codev opened this issue Jul 18, 2013 · 1 comment
Closed

page_cache_directory is not initialized or set from config #5

codev opened this issue Jul 18, 2013 · 1 comment

Comments

@codev
Copy link

codev commented Jul 18, 2013

In Rails 3.2 page_cache_directory is initialized to app.config.paths["public"].first in:

https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_controller/railtie.rb

But this doesn't seem the case in this gem. It is never given a default and the value is never copied over from config so the page_cache_directory variable is always blank.

This results in the gem trying to write pages to the root of my web server when upgrading to Rails 4.

@Xuhao
Copy link

Xuhao commented Sep 22, 2013

I use this gem on my project which upgrade to rails4 form rails3.2.

The README is not correct, It does not work as it said.

Here is my solution:

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  include ActionController::Caching::Pages
  self.page_cache_directory = Rails.public_path
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants