mirror of
https://github.com/github/rails.git
synced 2026-01-14 17:18:04 -05:00
Fixed docs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4079 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -44,13 +44,12 @@ end
|
||||
Rake::RDocTask.new { |rdoc|
|
||||
rdoc.rdoc_dir = 'doc'
|
||||
rdoc.title = "Action Pack -- On rails from request to response"
|
||||
rdoc.options << '--line-numbers' << '--inline-source' << '--main README'
|
||||
rdoc.options << '--line-numbers' << '--inline-source'
|
||||
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
||||
rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
|
||||
rdoc.rdoc_files.include('lib/**/*.rb')
|
||||
}
|
||||
|
||||
|
||||
# Create compressed packages
|
||||
dist_dirs = [ "lib", "test", "examples" ]
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ module ActionController #:nodoc:
|
||||
result
|
||||
end
|
||||
|
||||
def render_action(action_name, status = nil, with_layout = true)
|
||||
def render_action(action_name, status = nil, with_layout = true) #:nodoc:
|
||||
template = default_template_name(action_name.to_s)
|
||||
if with_layout && !template_exempt_from_layout?(template)
|
||||
render_with_layout(template, status)
|
||||
@@ -690,69 +690,68 @@ module ActionController #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
def render_file(template_path, status = nil, use_full_path = false, locals = {})
|
||||
def render_file(template_path, status = nil, use_full_path = false, locals = {}) #:nodoc:
|
||||
add_variables_to_assigns
|
||||
assert_existence_of_template_file(template_path) if use_full_path
|
||||
logger.info("Rendering #{template_path}" + (status ? " (#{status})" : '')) if logger
|
||||
render_text(@template.render_file(template_path, use_full_path, locals), status)
|
||||
end
|
||||
|
||||
def render_template(template, status = nil, type = :rhtml, local_assigns = {})
|
||||
def render_template(template, status = nil, type = :rhtml, local_assigns = {}) #:nodoc:
|
||||
add_variables_to_assigns
|
||||
render_text(@template.render_template(type, template, nil, local_assigns), status)
|
||||
end
|
||||
|
||||
def render_text(text = nil, status = nil)
|
||||
def render_text(text = nil, status = nil) #:nodoc:
|
||||
@performed_render = true
|
||||
@response.headers['Status'] = (status || DEFAULT_RENDER_STATUS_CODE).to_s
|
||||
@response.body = text
|
||||
end
|
||||
|
||||
def render_javascript(javascript, status = nil)
|
||||
def render_javascript(javascript, status = nil) #:nodoc:
|
||||
@response.headers['Content-Type'] = 'text/javascript; charset=UTF-8'
|
||||
render_text(javascript, status)
|
||||
end
|
||||
|
||||
def render_xml(xml, status = nil)
|
||||
def render_xml(xml, status = nil) #:nodoc:
|
||||
@response.headers['Content-Type'] = 'application/xml'
|
||||
render_text(xml, status)
|
||||
end
|
||||
|
||||
def render_nothing(status = nil)
|
||||
def render_nothing(status = nil) #:nodoc:
|
||||
render_text(' ', status)
|
||||
end
|
||||
|
||||
def render_partial(partial_path = default_template_name, object = nil, local_assigns = nil, status = nil)
|
||||
def render_partial(partial_path = default_template_name, object = nil, local_assigns = nil, status = nil) #:nodoc:
|
||||
add_variables_to_assigns
|
||||
render_text(@template.render_partial(partial_path, object, local_assigns), status)
|
||||
end
|
||||
|
||||
def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = nil, status = nil)
|
||||
def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = nil, status = nil) #:nodoc:
|
||||
add_variables_to_assigns
|
||||
render_text(@template.render_partial_collection(partial_name, collection, partial_spacer_template, local_assigns), status)
|
||||
end
|
||||
|
||||
def render_with_layout(template_name = default_template_name, status = nil, layout = nil)
|
||||
def render_with_layout(template_name = default_template_name, status = nil, layout = nil) #:nodoc:
|
||||
render_with_a_layout(template_name, status, layout)
|
||||
end
|
||||
|
||||
def render_without_layout(template_name = default_template_name, status = nil)
|
||||
def render_without_layout(template_name = default_template_name, status = nil) #:nodoc:
|
||||
render_with_no_layout(template_name, status)
|
||||
end
|
||||
|
||||
|
||||
# Clears the rendered results, allowing for another render to be performed.
|
||||
def erase_render_results
|
||||
def erase_render_results #:nodoc:
|
||||
@response.body = nil
|
||||
@performed_render = false
|
||||
end
|
||||
|
||||
|
||||
# Clears the redirected results from the headers, resets the status to 200 and returns
|
||||
# the URL that was used to redirect or nil if there was no redirected URL
|
||||
# Note that +redirect_to+ will change the body of the response to indicate a redirection.
|
||||
# The response body is not reset here, see +erase_render_results+
|
||||
def erase_redirect_results
|
||||
def erase_redirect_results #:nodoc:
|
||||
@performed_redirect = false
|
||||
response.redirected_to = nil
|
||||
response.redirected_to_method_params = nil
|
||||
@@ -761,12 +760,12 @@ module ActionController #:nodoc:
|
||||
end
|
||||
|
||||
# Erase both render and redirect results
|
||||
def erase_results
|
||||
def erase_results #:nodoc:
|
||||
erase_render_results
|
||||
erase_redirect_results
|
||||
end
|
||||
|
||||
def rewrite_options(options)
|
||||
def rewrite_options(options) #:nodoc:
|
||||
if defaults = default_url_options(options)
|
||||
defaults.merge(options)
|
||||
else
|
||||
|
||||
@@ -115,7 +115,7 @@ module ActionController #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
def flash_with_components(refresh = false)
|
||||
def flash_with_components(refresh = false) #:nodoc:
|
||||
if @flash.nil? || refresh
|
||||
@flash =
|
||||
if @parent_controller
|
||||
|
||||
@@ -28,7 +28,7 @@ module ActionController #:nodoc:
|
||||
#
|
||||
# Also note, that if the models follow the pattern of just 1 class per file in the form of MyClass => my_class.rb, then these
|
||||
# classes don't have to be required as Active Support will auto-require them.
|
||||
module ClassMethods
|
||||
module ClassMethods #:nodoc:
|
||||
# Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar
|
||||
# backend for modelling entity classes.
|
||||
def model(*models)
|
||||
|
||||
@@ -2,14 +2,14 @@ module ActionController
|
||||
class Base
|
||||
protected
|
||||
# Deprecated in favor of calling redirect_to directly with the path.
|
||||
def redirect_to_path(path)
|
||||
def redirect_to_path(path) #:nodoc:
|
||||
redirect_to(path)
|
||||
end
|
||||
|
||||
# Deprecated in favor of calling redirect_to directly with the url. If the resource has moved permanently, it's possible to pass
|
||||
# true as the second parameter and the browser will get "301 Moved Permanently" instead of "302 Found". This can also be done through
|
||||
# just setting the headers["Status"] to "301 Moved Permanently" before using the redirect_to.
|
||||
def redirect_to_url(url, permanently = false)
|
||||
def redirect_to_url(url, permanently = false) #:nodoc:
|
||||
headers["Status"] = "301 Moved Permanently" if permanently
|
||||
redirect_to(url)
|
||||
end
|
||||
|
||||
@@ -136,7 +136,7 @@ module ActionController #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
module InstanceMethods #:nodoc:
|
||||
def assign_shortcuts_with_flash(request, response) #:nodoc:
|
||||
assign_shortcuts_without_flash(request, response)
|
||||
flash(:refresh)
|
||||
|
||||
@@ -3,8 +3,7 @@ require 'stringio'
|
||||
require 'uri'
|
||||
|
||||
module ActionController
|
||||
module Integration
|
||||
|
||||
module Integration #:nodoc:
|
||||
# An integration Session instance represents a set of requests and responses
|
||||
# performed sequentially by some virtual user. Becase you can instantiate
|
||||
# multiple sessions and run them side-by-side, you can also mimic (to some
|
||||
@@ -169,7 +168,7 @@ module ActionController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
class MockCGI < CGI #:nodoc:
|
||||
attr_accessor :stdinput, :stdoutput, :env_table
|
||||
|
||||
@@ -319,7 +318,7 @@ module ActionController
|
||||
end
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
module ClassMethods #:nodoc:
|
||||
mattr_accessor :last_instantiation
|
||||
|
||||
def clear_last_instantiation!
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module Mime
|
||||
class Type
|
||||
|
||||
class Type #:nodoc:
|
||||
# A simple helper class used in parsing the accept header
|
||||
class AcceptItem #:nodoc:
|
||||
attr_accessor :order, :name, :q
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'rexml/document'
|
||||
|
||||
# SimpleXML like xml parser. Written by leon breet from the ruby on rails Mailing list
|
||||
class XmlNode
|
||||
class XmlNode #:nodoc:
|
||||
attr :node
|
||||
|
||||
def initialize(node, options = {})
|
||||
@@ -81,7 +81,7 @@ class XmlNode
|
||||
end
|
||||
end
|
||||
|
||||
class XmlNodeList < Array
|
||||
class XmlNodeList < Array #:nodoc:
|
||||
def [](i)
|
||||
i.is_a?(String) ? super(0)[i] : super(i)
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module ActionPack
|
||||
module ActionPack #:nodoc:
|
||||
module VERSION #:nodoc:
|
||||
MAJOR = 1
|
||||
MINOR = 11
|
||||
|
||||
@@ -221,7 +221,7 @@ module ActionView #:nodoc:
|
||||
# Renders the template present at <tt>template_path</tt>. If <tt>use_full_path</tt> is set to true,
|
||||
# it's relative to the template_root, otherwise it's absolute. The hash in <tt>local_assigns</tt>
|
||||
# is made available as local variables.
|
||||
def render_file(template_path, use_full_path = true, local_assigns = {})
|
||||
def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc:
|
||||
@first_render ||= template_path
|
||||
|
||||
if use_full_path
|
||||
@@ -254,7 +254,7 @@ module ActionView #:nodoc:
|
||||
|
||||
# Renders the template present at <tt>template_path</tt> (relative to the template_root).
|
||||
# The hash in <tt>local_assigns</tt> is made available as local variables.
|
||||
def render(options = {}, old_local_assigns = {}, &block)
|
||||
def render(options = {}, old_local_assigns = {}, &block) #:nodoc:
|
||||
if options.is_a?(String)
|
||||
render_file(options, true, old_local_assigns)
|
||||
elsif options == :update
|
||||
@@ -277,7 +277,7 @@ module ActionView #:nodoc:
|
||||
|
||||
# Renders the +template+ which is given as a string as either rhtml or rxml depending on <tt>template_extension</tt>.
|
||||
# The hash in <tt>local_assigns</tt> is made available as local variables.
|
||||
def render_template(template_extension, template, file_path = nil, local_assigns = {})
|
||||
def render_template(template_extension, template, file_path = nil, local_assigns = {}) #:nodoc:
|
||||
if handler = @@template_handlers[template_extension]
|
||||
template ||= read_template_file(file_path, template_extension) # Make sure that a lazyily-read template is loaded.
|
||||
delegate_render(handler, template, local_assigns)
|
||||
@@ -293,7 +293,7 @@ module ActionView #:nodoc:
|
||||
# Either, but not both, of template and file_path may be nil. If file_path is given, the template
|
||||
# will only be read if it has to be compiled.
|
||||
#
|
||||
def compile_and_render_template(extension, template = nil, file_path = nil, local_assigns = {})
|
||||
def compile_and_render_template(extension, template = nil, file_path = nil, local_assigns = {}) #:nodoc:
|
||||
# compile the given template, if necessary
|
||||
if compile_template?(template, file_path, local_assigns)
|
||||
template ||= read_template_file(file_path, extension)
|
||||
|
||||
@@ -10,7 +10,7 @@ module ActionView
|
||||
#
|
||||
# To use a compiled template module, create a new instance and include it into the class
|
||||
# in which you want the template to be rendered.
|
||||
class CompiledTemplates < Module
|
||||
class CompiledTemplates < Module #:nodoc:
|
||||
attr_reader :method_names
|
||||
|
||||
def initialize
|
||||
|
||||
Reference in New Issue
Block a user