0
- # All request parameters
whether they come from a GET or POST request, or from the URL, are available through the params hash.
0
+ # All request parameters
, whether they come from a GET or POST request, or from the URL, are available through the params hash.
0
# So an action that was performed through /weblog/list?category=All&limit=5 will include { "category" => "All", "limit" => 5 }
0
# the post again, but rather just show it one more time.
0
# This sounds fairly simple, but the redirection is complicated by the quest for a phenomenon known as "pretty urls". Instead of accepting
0
- # the dreadful being
s that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as
0
+ # the dreadful being
that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as
0
# "/weblog/show/5". And this is even the simple case. As an example of a more advanced pretty url consider
0
# "/library/books/ISBN/0743536703/show", which can be mapped to books_controller?action=show&type=ISBN&id=0743536703.
0
# == Calling multiple redirects or renders
0
- # An action should conclude
by a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError:
0
+ # An action should conclude
with a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError:
0
# redirect_to :action => "elsewhere"
0
cattr_accessor :debug_routes
0
- # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know
s whether to apply a mutex
0
+ # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know
whether to apply a mutex
0
# around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications
0
# may not be. Turned off by default.
0
@@allow_concurrency = false
0
attr_accessor :response
0
# Holds a hash of objects in the session. Accessed like <tt>session[:person]</tt> to get the object tied to the "person"
0
- # key. The session will hold any type of object as values, but the key should be a string
.
0
+ # key. The session will hold any type of object as values, but the key should be a string
or symbol.
0
# Holds a hash of header names and values. Accessed like <tt>headers["Cache-Control"]</tt> to get the value of the Cache-Control
0
@controller_name ||= controller_class_name.sub(/Controller$/, '').underscore
0
- # Convert
the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat".
0
+ # Convert
s the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat".
0
unless @controller_path
0
components = self.name.to_s.split('::')
0
# <tt>url_for</tt> is used to:
0
- # All keys given to url_for are forwarded to the Route module
save for the following:
0
+ # All keys given to url_for are forwarded to the Route module
, save for the following:
0
# * <tt>:anchor</tt> -- specifies the anchor name to be appended to the path. For example,
0
# <tt>url_for :controller => 'posts', :action => 'show', :id => 10, :anchor => 'comments'</tt>
0
# will produce "/posts/show/10#comments".
0
# The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the
0
# route given by <tt>map.connect 'people/:last/:first/:action', :action => 'bio', :controller => 'people'</tt>.
0
- # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases
URLs which are generated
0
+ # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases
of URLs which are generated
0
# * <tt>url_for :action => 'bio'</tt> -- During the generation of this URL, default values will be used for the first and
0
# url_for :overwrite_params => { :action => 'print' }
0
# This takes the current URL as is and only exchanges the action. In contrast, <tt>url_for :action => 'print'</tt>
0
- # would have slashed-off the path components a
re the changed action.
0
+ # would have slashed-off the path components a
fter the changed action.
0
def url_for(options = {}, *parameters_for_method_reference) #:doc:
0
when String then options
0
# === Rendering partials
0
- # Partial rendering is most commonly used together with Ajax calls that only update
s one or a few elements on a page
0
+ # Partial rendering is most commonly used together with Ajax calls that only update
one or a few elements on a page
0
# without reloading. Rendering of partials from the controller makes it possible to use the same partial template in
0
# both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the
0
# controller action responding to Ajax calls). By default, the current layout is not used.
0
@performed_render = false
0
- # Clears the redirected results from the headers, reset
ting the status to 200 and returns
0
+ # Clears the redirected results from the headers, reset
s the status to 200 and returns
0
# the URL that was used to redirect or nil if there was no redirected URL
0
# Note that +redirect_to+ will change the body of the response to indicate a redirection.
0
# The response body is not reset here, see +erase_render_results+
Comments
No one has commented yet.