mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
dd98280e38
commit
de203245af
23 changed files with 272 additions and 266 deletions
|
@ -12,7 +12,6 @@ module AbstractController
|
|||
end
|
||||
|
||||
class Base
|
||||
|
||||
attr_internal :response_body
|
||||
attr_internal :response_obj
|
||||
attr_internal :action_name
|
||||
|
@ -80,7 +79,6 @@ module AbstractController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def action_methods
|
||||
self.class.action_methods
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module AbstractController
|
||||
class ActionNotFound < StandardError ; end
|
||||
class ActionNotFound < StandardError; end
|
||||
end
|
|
@ -68,6 +68,5 @@ module AbstractController
|
|||
master_helper_module.module_eval(&block) if block_given?
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -59,8 +59,9 @@ module AbstractController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def _layout(details) end # This will be overwritten
|
||||
# This will be overwritten
|
||||
def _layout(details)
|
||||
end
|
||||
|
||||
# :api: plugin
|
||||
# ====
|
||||
|
|
|
@ -56,7 +56,9 @@ module AbstractController
|
|||
_action_view._render_template_from_controller(options[:_template], options[:_layout], options, options[:_partial])
|
||||
end
|
||||
|
||||
def view_paths() _view_paths end
|
||||
def view_paths()
|
||||
_view_paths
|
||||
end
|
||||
|
||||
# Return a string representation of a Rack-compatible response body.
|
||||
def self.body_to_s(body)
|
||||
|
@ -71,7 +73,6 @@ module AbstractController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def _determine_template(options)
|
||||
name = (options[:_template_name] || action_name).to_s
|
||||
|
||||
|
@ -81,7 +82,6 @@ module AbstractController
|
|||
end
|
||||
|
||||
module ClassMethods
|
||||
|
||||
def append_view_path(path)
|
||||
self.view_paths << path
|
||||
end
|
||||
|
|
|
@ -81,7 +81,9 @@ module ActionController
|
|||
end
|
||||
|
||||
module ClassMethods
|
||||
def consider_all_requests_local() end
|
||||
def consider_all_requests_local
|
||||
end
|
||||
|
||||
def rescue_action(env)
|
||||
raise env["action_dispatch.rescue.exception"]
|
||||
end
|
||||
|
|
|
@ -129,6 +129,5 @@ module ActionController
|
|||
def expires_now #:doc:
|
||||
response.headers["Cache-Control"] = "no-cache"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -106,7 +106,6 @@ module ActionController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def default_helper_module!
|
||||
unless name.blank?
|
||||
module_name = name.sub(/Controller$|$/, 'Helper')
|
||||
|
@ -125,6 +124,6 @@ module ActionController
|
|||
extract = /^#{Regexp.quote(helpers_dir)}\/?(.*)_helper.rb$/
|
||||
Dir["#{helpers_dir}/**/*_helper.rb"].map { |file| file.sub extract, '\1' }
|
||||
end
|
||||
end # ClassMethods
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,11 +7,15 @@ module ActionController
|
|||
self.hidden_actions ||= Set.new
|
||||
end
|
||||
|
||||
def action_methods() self.class.action_names end
|
||||
def action_names() action_methods end
|
||||
def action_methods
|
||||
self.class.action_names
|
||||
end
|
||||
|
||||
def action_names
|
||||
action_methods
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def action_method?(action_name)
|
||||
!hidden_actions.include?(action_name) && super
|
||||
end
|
||||
|
@ -27,7 +31,9 @@ module ActionController
|
|||
@action_names ||= Set.new(super.reject {|name| self.hidden_actions.include?(name.to_s)})
|
||||
end
|
||||
|
||||
def self.action_names() action_methods end
|
||||
def self.action_names
|
||||
action_methods
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -14,7 +14,9 @@ module ActionController
|
|||
end
|
||||
|
||||
# :api: public
|
||||
def controller_name() self.class.controller_name end
|
||||
def controller_name
|
||||
self.class.controller_name
|
||||
end
|
||||
|
||||
# :api: public
|
||||
def self.controller_path
|
||||
|
@ -22,13 +24,19 @@ module ActionController
|
|||
end
|
||||
|
||||
# :api: public
|
||||
def controller_path() self.class.controller_path end
|
||||
def controller_path
|
||||
self.class.controller_path
|
||||
end
|
||||
|
||||
# :api: private
|
||||
def self.action_names() action_methods end
|
||||
def self.action_names
|
||||
action_methods
|
||||
end
|
||||
|
||||
# :api: private
|
||||
def action_names() action_methods end
|
||||
def action_names
|
||||
action_methods
|
||||
end
|
||||
|
||||
# :api: plugin
|
||||
def self.call(env)
|
||||
|
|
|
@ -12,7 +12,6 @@ module ActionController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def _determine_template(options)
|
||||
super
|
||||
if (!options.key?(:text) && !options.key?(:inline) && !options.key?(:partial)) || options.key?(:layout)
|
||||
|
@ -31,6 +30,5 @@ module ActionController
|
|||
"String, true, or false, expected for `layout'; you passed #{name.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,6 +29,5 @@ module ActionController
|
|||
response.body = body if response
|
||||
super
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -30,7 +30,6 @@ module ActionController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def _prefix
|
||||
controller_path
|
||||
end
|
||||
|
|
|
@ -33,7 +33,6 @@ module ActionController #:nodoc:
|
|||
attr_internal :rescued_exception
|
||||
|
||||
private
|
||||
|
||||
def method_for_action(action_name)
|
||||
return action_name if self.rescued_exception = request.env.delete("action_dispatch.rescue.exception")
|
||||
super
|
||||
|
|
|
@ -35,6 +35,5 @@ module ActionController
|
|||
_process_action_callbacks.find_all{|x| x.kind == :before}.map{|x| x.name}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue