blob: 489288634163cf982b77b5166e6bbd27151d2f73 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
module ActionController
class Base < Http
abstract!
include AbstractController::Callbacks
include AbstractController::Helpers
include AbstractController::Logger
include ActionController::HideActions
include ActionController::UrlFor
include ActionController::Renderer
include ActionController::Layouts
include ActionController::ConditionalGet
# Legacy modules
include SessionManagement
include ActionDispatch::StatusCodes
# Rails 2.x compatibility
include ActionController::Rails2Compatibility
def self.inherited(klass)
::ActionController::Base.subclasses << klass.to_s
super
end
def self.subclasses
@subclasses ||= []
end
def self.app_loaded!
@subclasses.each do |subclass|
subclass.constantize._write_layout_method
end
end
def render(action = action_name, options = {})
if action.is_a?(Hash)
options, action = action, nil
else
options.merge! :action => action
end
super(options)
end
def render_to_body(options = {})
options = {:template => options} if options.is_a?(String)
super
end
def process_action
ret = super
render if response_body.nil?
ret
end
def respond_to_action?(action_name)
super || view_paths.find_by_parts?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path)
end
end
end
|