diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-20 14:41:23 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-20 15:02:13 +0100 |
commit | 6e26be69606c52dbccfad366661b455157c35be4 (patch) | |
tree | a93b713b2d89cbab601fabfe1c2f54e21415e673 /actionpack/lib/abstract_controller | |
parent | 8e2fd54b19656a6edbd94f8707927d09e167e7fc (diff) | |
download | rails-6e26be69606c52dbccfad366661b455157c35be4.tar.gz rails-6e26be69606c52dbccfad366661b455157c35be4.tar.bz2 rails-6e26be69606c52dbccfad366661b455157c35be4.zip |
Move ActionController::Translation to AbstractController::Translation.
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/translation.rb | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 644419a585..826e82c8c6 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -42,7 +42,7 @@ module AbstractController # Delegates render_to_body and sticks the result in self.response_body. def render(*args, &block) if response_body - raise AbstractController::DoubleRenderError, "Can only render or redirect once per action" + raise AbstractController::DoubleRenderError end options = _normalize_options(*args, &block) diff --git a/actionpack/lib/abstract_controller/translation.rb b/actionpack/lib/abstract_controller/translation.rb new file mode 100644 index 0000000000..6d68cf4944 --- /dev/null +++ b/actionpack/lib/abstract_controller/translation.rb @@ -0,0 +1,13 @@ +module AbstractController + module Translation + def translate(*args) + I18n.translate(*args) + end + alias :t :translate + + def localize(*args) + I18n.localize(*args) + end + alias :l :localize + end +end
\ No newline at end of file |