履歴: ソフトウェア/rails/言語ネゴシエーション

各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 21 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます

日時タイトル文字数追加削除内容差分基準
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 最新版3,891+1 -1表示差分—
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 3,897+8 -1表示差分選択
2013/1/5 18:30:15ソフトウェア/rails/言語ネゴシエーション 3,842+3 -0表示差分選択
2009/7/14 9:35:50ソフトウェア/rails/言語ネゴシエーション 3,732+43 -27表示差分選択
2009/7/11 15:06:20ソフトウェア/rails/言語ネゴシエーション 3,727+9 -0表示差分選択
2009/6/28 2:02:38ソフトウェア/rails/言語ネゴシエーション 3,515+2 -0表示差分選択
2009/6/27 8:15:42ソフトウェア/rails/言語ネゴシエーション 3,458+4 -0表示差分選択
2009/6/21 9:14:00ソフトウェア/rails/言語ネゴシエーション 3,403+15 -0表示差分選択
2009/6/21 6:41:27ソフトウェア/rails/言語ネゴシエーション 3,126+62 -2793表示差分選択
2009/6/10 11:14:13ソフトウェア/rails/言語ネゴシエーション 84,051+327 -1表示差分選択
2009/6/10 3:14:21ソフトウェア/rails/言語ネゴシエーション 73,730+459 -3表示差分選択
2009/6/9 15:42:54ソフトウェア/rails/言語ネゴシエーション 58,379+247 -473表示差分選択
2009/6/9 11:29:37ソフトウェア/rails/言語ネゴシエーション 66,074+317 -40表示差分選択
2009/6/8 20:22:16ソフトウェア/rails/言語ネゴシエーション 58,607+75 -2表示差分選択
2009/6/8 15:18:39ソフトウェア/rails/言語ネゴシエーション 55,917+958 -223表示差分選択
2009/6/8 8:00:44ソフトウェア/rails/言語ネゴシエーション 33,858+247 -35表示差分選択
2009/6/7 13:55:06ソフトウェア/rails/言語ネゴシエーション 28,314+195 -18表示差分選択
2009/6/7 4:15:30ソフトウェア/rails/言語ネゴシエーション 23,332+140 -3表示差分選択
2009/6/6 14:50:13ソフトウェア/rails/言語ネゴシエーション 19,622+30 -27表示表示中選択
2009/6/6 6:50:47ソフトウェア/rails/言語ネゴシエーション 19,701+581 -3表示差分基準
2009/6/6 2:59:56ソフトウェア/rails/言語ネゴシエーション 2,869— —表示—選択

基準: ソフトウェア/rails/言語ネゴシエーション (2009/6/6 6:50:47) → 比較: ソフトウェア/rails/言語ネゴシエーション (2009/6/6 14:50:13)

@@ -383,7 +383,7 @@
return template_path if template_path.respond_to?(:render)
path = template_path.sub(/^\//, '')
- if m = path.match(/(.*)\.(\w+)$/) && ActionView::Template.valid_extension?(m[2])
+ if ( m = path.match(/(.*)\.(\w+)$/) ) && ActionView::Template.template_handler_extensions.include?(m[2])
template_file_name, template_file_extension = m[1], m[2]
else
template_file_name = path
@@ -651,31 +651,34 @@
* ページキャッシュの多言語対応 [#z6cc2a4b]
キャッシュファイルは ActionController::Caching が作成する。
-ファイルの名前を付ける部分で url_for が呼ばれているので、
-この引数に :rails_language を渡せばよい。
- LANG:ruby(linenumber)
- module ActionController
- module Caching
- def cache_page(content = nil, options = nil)
- return unless perform_caching && caching_allowed
-
- path = case options
- when Hash
- url_for(options.merge(
- :only_path => true,
- :skip_relative_url_root => true,
- :format => params[:format],
- :rails_language => request.language))
- when String
- options
- else
- request.path
- end
-
- self.class.cache_page(content || response.body, path)
- end
- end
- end
+まずは rails そのままで、ページキャッシュ機能をONにしてみる。
-** テスト [#mee8ebea]
+ LANG:console
+ $ jed config/environments/development.rb
+ config.action_controller.perform_caching = true
+ $ jed app/controller/test_controller.rb
+ class TestController < ApplicationController
+ caches_page :index
+ def index
+ end
+ end
+ $ wgetc -qO- http://localhost:3000/test
+ English: Test OK
+
+
+ $ ls public/test*
+ public/test.html
+ $ cat public/test.html
+ English: Test OK
+
+
+ $ wgetc -qO- http://localhost:3000/test.en
+ English: Test OK
+
+
+ $ ls public/test*
+ public/test.html public/test.en
+
+test.html というファイルができてしまうと、
+次回からは常にこれが表示されてしまうため、うまくいかない。