Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Dont log the _method attribute either. Its already available in the h…

…eader
  • Loading branch information...
commit a909eecbbd42e70a5bc0e099485f07dc64db5d38 2 parents b29f95e + 18bf7b4
@dhh dhh authored
Showing with 1,167 additions and 47,375 deletions.
  1. +4 −13 actionpack/lib/action_controller/base.rb
  2. +2 −1  actionpack/lib/action_controller/request.rb
  3. +19 −7 actionpack/lib/action_controller/routing/optimisations.rb
  4. +5 −5 actionpack/lib/action_view/helpers/text_helper.rb
  5. +13 −0 actionpack/test/template/url_helper_test.rb
  6. +8 −0 activerecord/lib/active_record/associations.rb
  7. +103 −1 activesupport/lib/active_support/cache.rb
  8. +1 −0  activesupport/lib/active_support/cache/file_store.rb
  9. +33 −9 activesupport/lib/active_support/cache/mem_cache_store.rb
  10. +14 −0 activesupport/lib/active_support/cache/memory_store.rb
  11. +1 −0  activesupport/lib/active_support/cache/synchronized_memory_store.rb
  12. +1 −1  activesupport/lib/active_support/testing/performance.rb
  13. +44 −24 railties/doc/guides/html/2_2_release_notes.html
  14. +0 −1  railties/doc/guides/html/actioncontroller_basics.html
  15. +9 −1 railties/doc/guides/html/association_basics.html
  16. +343 −310 railties/doc/guides/html/finders.html
  17. +5 −0 railties/doc/guides/html/getting_started_with_rails.html
  18. +0 −16 railties/doc/guides/html/index.html
  19. +110 −48 railties/doc/guides/html/layouts_and_rendering.html
  20. +1 −1  railties/doc/guides/html/routing_outside_in.html
  21. +14 −0 railties/doc/guides/html/security.html
  22. +28 −24 railties/doc/guides/source/2_2_release_notes.txt
  23. +0 −2  railties/doc/guides/source/actioncontroller_basics/filters.txt
  24. +2 −2 railties/doc/guides/source/active_record_basics.txt
  25. +3 −1 railties/doc/guides/source/association_basics.txt
  26. +0 −45,904 railties/doc/guides/source/benchmarking_and_profiling/examples/graph.html
  27. +0 −412 railties/doc/guides/source/benchmarking_and_profiling/images/kgraph.png.html
  28. +0 −412 railties/doc/guides/source/benchmarking_and_profiling/images/klist.png.html
  29. +302 −143 railties/doc/guides/source/finders.txt
  30. +1 −0  railties/doc/guides/source/getting_started_with_rails.txt
  31. +0 −4 railties/doc/guides/source/index.txt
  32. +67 −18 railties/doc/guides/source/layouts_and_rendering.txt
  33. +1 −1  railties/doc/guides/source/routing_outside_in.txt
  34. +6 −0 railties/doc/guides/source/security.txt
  35. +1 −0  railties/lib/initializer.rb
  36. +24 −13 railties/lib/rails/gem_dependency.rb
  37. +2 −1  railties/lib/tasks/gems.rake
View
17 actionpack/lib/action_controller/base.rb
@@ -278,12 +278,6 @@ class Base
@@consider_all_requests_local = true
cattr_accessor :consider_all_requests_local
- # Enable or disable the collection of failure information for RoutingErrors.
- # This information can be extremely useful when tweaking custom routes, but is
- # pointless once routes have been tested and verified.
- @@debug_routes = true
- cattr_accessor :debug_routes
-
# Indicates whether to allow concurrent action processing. Your
# controller actions and any other code they call must also behave well
# when called from concurrent threads. Turned off by default.
@@ -364,11 +358,8 @@ class Base
# If you are deploying to a subdirectory, you will need to set
# <tt>config.action_controller.relative_url_root</tt>
# This defaults to ENV['RAILS_RELATIVE_URL_ROOT']
- cattr_writer :relative_url_root
-
- def self.relative_url_root
- @@relative_url_root || ENV['RAILS_RELATIVE_URL_ROOT']
- end
+ cattr_accessor :relative_url_root
+ self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
# Holds the request object that's primarily used to get environment variables through access like
# <tt>request.env["REQUEST_URI"]</tt>.
@@ -1247,8 +1238,8 @@ def log_processing_for_session_id
end
def log_processing_for_parameters
- parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params
- parameters = parameters.except(:controller, :action, :format, :_method)
+ parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params.dup
+ parameters = parameters.except!(:controller, :action, :format, :_method)
logger.info " Parameters: #{parameters.inspect}"
end
View
3  actionpack/lib/action_controller/request.rb
@@ -9,10 +9,11 @@ module ActionController
class AbstractRequest
extend ActiveSupport::Memoizable
- def self.relative_url_root=(*args)
+ def self.relative_url_root=(relative_url_root)
ActiveSupport::Deprecation.warn(
"ActionController::AbstractRequest.relative_url_root= has been renamed." +
"You can now set it with config.action_controller.relative_url_root=", caller)
+ ActionController::base.relative_url_root=relative_url_root
end
HTTP_METHODS = %w(get head put post delete options)
View
26 actionpack/lib/action_controller/routing/optimisations.rb
@@ -20,14 +20,20 @@ def generate_optimisation_block(route, kind)
class Optimiser
attr_reader :route, :kind
+ GLOBAL_GUARD_CONDITIONS = [
+ "(!defined?(default_url_options) || default_url_options.blank?)",
+ "(!defined?(controller.default_url_options) || controller.default_url_options.blank?)",
+ "defined?(request)",
+ "request"
+ ]
def initialize(route, kind)
@route = route
@kind = kind
end
- def guard_condition
- 'false'
+ def guard_conditions
+ ["false"]
end
def generation_code
@@ -36,6 +42,7 @@ def generation_code
def source_code
if applicable?
+ guard_condition = (GLOBAL_GUARD_CONDITIONS + guard_conditions).join(" && ")
"return #{generation_code} if #{guard_condition}\n"
else
"\n"
@@ -57,14 +64,14 @@ def applicable?
# return a string like "/people/#{@person.to_param}"
# rather than triggering the expensive logic in +url_for+.
class PositionalArguments < Optimiser
- def guard_condition
+ def guard_conditions
number_of_arguments = route.segment_keys.size
# if they're using foo_url(:id=>2) it's one
# argument, but we don't want to generate /foos/id2
if number_of_arguments == 1
- "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == 1 && !args.first.is_a?(Hash)"
+ ["args.size == 1", "!args.first.is_a?(Hash)"]
else
- "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == #{number_of_arguments}"
+ ["args.size == #{number_of_arguments}"]
end
end
@@ -98,8 +105,13 @@ def generation_code
# above, but it supports additional query parameters as the last
# argument
class PositionalArgumentsWithAdditionalParams < PositionalArguments
- def guard_condition
- "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == #{route.segment_keys.size + 1} && !args.last.has_key?(:anchor) && !args.last.has_key?(:port) && !args.last.has_key?(:host)"
+ def guard_conditions
+ [
+ "args.size == #{route.segment_keys.size + 1}",
+ "!args.last.has_key?(:anchor)",
+ "!args.last.has_key?(:port)",
+ "!args.last.has_key?(:host)"
+ ]
end
# This case uses almost the same code as positional arguments,
View
10 actionpack/lib/action_view/helpers/text_helper.rb
@@ -344,9 +344,9 @@ def simple_format(text, html_options={})
text << "</p>"
end
- # Turns all URLs and e-mail addresses into clickable links. The +link+ parameter
+ # Turns all URLs and e-mail addresses into clickable links. The <tt>:link</tt> option
# will limit what should be linked. You can add HTML attributes to the links using
- # +href_options+. Options for +link+ are <tt>:all</tt> (default),
+ # <tt>:href_options</tt>. Possible values for <tt>:link</tt> are <tt>:all</tt> (default),
# <tt>:email_addresses</tt>, and <tt>:urls</tt>. If a block is given, each URL and
# e-mail address is yielded and the result is used as the link text.
#
@@ -355,15 +355,15 @@ def simple_format(text, html_options={})
# # => "Go to <a href=\"http://www.rubyonrails.org\">http://www.rubyonrails.org</a> and
# # say hello to <a href=\"mailto:david@loudthinking.com\">david@loudthinking.com</a>"
#
- # auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com", :urls)
+ # auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com", :link => :urls)
# # => "Visit <a href=\"http://www.loudthinking.com/\">http://www.loudthinking.com/</a>
# # or e-mail david@loudthinking.com"
#
- # auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com", :email_addresses)
+ # auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com", :link => :email_addresses)
# # => "Visit http://www.loudthinking.com/ or e-mail <a href=\"mailto:david@loudthinking.com\">david@loudthinking.com</a>"
#
# post_body = "Welcome to my new blog at http://www.myblog.com/. Please e-mail me at me@email.com."
- # auto_link(post_body, :all, :target => '_blank') do |text|
+ # auto_link(post_body, :href_options => { :target => '_blank' }) do |text|
# truncate(text, 15)
# end
# # => "Welcome to my new blog at <a href=\"http://www.myblog.com/\" target=\"_blank\">http://www.m...</a>.
View
13 actionpack/test/template/url_helper_test.rb
@@ -376,6 +376,19 @@ def test_url_for_nil_returns_current_path
assert_equal '/url_helper_with_controller/nil_url_for', @response.body
end
+ def test_named_route_should_show_host_and_path_using_controller_default_url_options
+ class << @controller
+ def default_url_options(options = nil)
+ {:host => 'testtwo.host'}
+ end
+ end
+
+ with_url_helper_routing do
+ get :show_named_route, :kind => 'url'
+ assert_equal 'http://testtwo.host/url_helper_with_controller/show_named_route', @response.body
+ end
+ end
+
protected
def with_url_helper_routing
with_routing do |set|
View
8 activerecord/lib/active_record/associations.rb
@@ -507,6 +507,14 @@ def clear_association_cache #:nodoc:
#
# will load posts and eager load the +approved_comments+ association, which contains only those comments that have been approved.
#
+ # If you eager load an association with a specified <tt>:limit</tt> option, it will be ignored, returning all the associated objects:
+ #
+ # class Picture < ActiveRecord::Base
+ # has_many :most_recent_comments, :class_name => 'Comment', :order => 'id DESC', :limit => 10
+ # end
+ #
+ # Picture.find(:first, :include => :most_recent_comments).most_recent_comments # => returns all associated comments.
+ #
# When eager loaded, conditions are interpolated in the context of the model class, not the model instance. Conditions are lazily interpolated
# before the actual model exists.
#
View
104 activesupport/lib/active_support/cache.rb
@@ -1,7 +1,33 @@
require 'benchmark'
module ActiveSupport
+ # See ActiveSupport::Cache::Store for documentation.
module Cache
+ # Creates a new CacheStore object according to the given options.
+ #
+ # If no arguments are passed to this method, then a new
+ # ActiveSupport::Cache::MemoryStore object will be returned.
+ #
+ # If you pass a Symbol as the first argument, then a corresponding cache
+ # store class under the ActiveSupport::Cache namespace will be created.
+ # For example:
+ #
+ # ActiveSupport::Cache.lookup_store(:memory_store)
+ # # => returns a new ActiveSupport::Cache::MemoryStore object
+ #
+ # ActiveSupport::Cache.lookup_store(:drb_store)
+ # # => returns a new ActiveSupport::Cache::DRbStore object
+ #
+ # Any additional arguments will be passed to the corresponding cache store
+ # class's constructor:
+ #
+ # ActiveSupport::Cache.lookup_store(:file_store, "/tmp/cache")
+ # # => same as: ActiveSupport::Cache::FileStore.new("/tmp/cache")
+ #
+ # If the first argument is not a Symbol, then it will simply be returned:
+ #
+ # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new)
+ # # => returns MyOwnCacheStore.new
def self.lookup_store(*store_option)
store, *parameters = *([ store_option ].flatten)
@@ -36,6 +62,21 @@ def self.expand_cache_key(key, namespace = nil)
expanded_cache_key
end
+ # An abstract cache store class. There are multiple cache store
+ # implementations, each having its own additional features. See the classes
+ # under the ActiveSupport::Cache module, e.g.
+ # ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most
+ # popular cache store for large production websites.
+ #
+ # ActiveSupport::Cache::Store is meant for caching strings. Some cache
+ # store implementations, like MemoryStore, are able to cache arbitrary
+ # Ruby objects, but don't count on every cache store to be able to do that.
+ #
+ # cache = ActiveSupport::Cache::MemoryStore.new
+ #
+ # cache.read("city") # => nil
+ # cache.write("city", "Duckburgh")
+ # cache.read("city") # => "Duckburgh"
class Store
cattr_accessor :logger
@@ -44,7 +85,46 @@ def silence!
self
end
- # Pass <tt>:force => true</tt> to force a cache miss.
+ # Fetches data from the cache, using the given key. If there is data in
+ # the cache with the given key, then that data is returned.
+ #
+ # If there is no such data in the cache (a cache miss occurred), then
+ # then nil will be returned. However, if a block has been passed, then
+ # that block will be run in the event of a cache miss. The return value
+ # of the block will be written to the cache under the given cache key,
+ # and that return value will be returned.
+ #
+ # cache.write("today", "Monday")
+ # cache.fetch("today") # => "Monday"
+ #
+ # cache.fetch("city") # => nil
+ # cache.fetch("city") do
+ # "Duckburgh"
+ # end
+ # cache.fetch("city") # => "Duckburgh"
+ #
+ # You may also specify additional options via the +options+ argument.
+ # Setting <tt>:force => true</tt> will force a cache miss:
+ #
+ # cache.write("today", "Monday")
+ # cache.fetch("today", :force => true) # => nil
+ #
+ # Other options will be handled by the specific cache store implementation.
+ # Internally, #fetch calls #read, and calls #write on a cache miss.
+ # +options+ will be passed to the #read and #write calls.
+ #
+ # For example, MemCacheStore's #write method supports the +:expires_in+
+ # option, which tells the memcached server to automatically expire the
+ # cache item after a certain period. We can use this option with #fetch
+ # too:
+ #
+ # cache = ActiveSupport::Cache::MemCacheStore.new
+ # cache.fetch("foo", :force => true, :expires_in => 5.seconds) do
+ # "bar"
+ # end
+ # cache.fetch("foo") # => "bar"
+ # sleep(6)
+ # cache.fetch("foo") # => nil
def fetch(key, options = {})
@logger_off = true
if !options[:force] && value = read(key, options)
@@ -68,10 +148,32 @@ def fetch(key, options = {})
end
end
+ # Fetches data from the cache, using the given key. If there is data in
+ # the cache with the given key, then that data is returned. Otherwise,
+ # nil is returned.
+ #
+ # You may also specify additional options via the +options+ argument.
+ # The specific cache store implementation will decide what to do with
+ # +options+.
def read(key, options = nil)
log("read", key, options)
end
+ # Writes the given value to the cache, with the given key.
+ #
+ # You may also specify additional options via the +options+ argument.
+ # The specific cache store implementation will decide what to do with
+ # +options+.
+ #
+ # For example, MemCacheStore supports the +:expires_in+ option, which
+ # tells the memcached server to automatically expire the cache item after
+ # a certain period:
+ #
+ # cache = ActiveSupport::Cache::MemCacheStore.new
+ # cache.write("foo", "bar", :expires_in => 5.seconds)
+ # cache.read("foo") # => "bar"
+ # sleep(6)
+ # cache.read("foo") # => nil
def write(key, value, options = nil)
log("write", key, options)
end
View
1  activesupport/lib/active_support/cache/file_store.rb
@@ -1,5 +1,6 @@
module ActiveSupport
module Cache
+ # A cache store implementation which stores everything on the filesystem.
class FileStore < Store
attr_reader :cache_path
View
42 activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -2,8 +2,19 @@
module ActiveSupport
module Cache
+ # A cache store implementation which stores data in Memcached:
+ # http://www.danga.com/memcached/
+ #
+ # This is currently the most popular cache store for production websites.
+ #
+ # Special features:
+ # - Clustering and load balancing. One can specify multiple memcached servers,
+ # and MemCacheStore will load balance between all available servers. If a
+ # server goes down, then MemCacheStore will ignore it until it goes back
+ # online.
+ # - Time-based expiry support. See #write and the +:expires_in+ option.
class MemCacheStore < Store
- module Response
+ module Response # :nodoc:
STORED = "STORED\r\n"
NOT_STORED = "NOT_STORED\r\n"
EXISTS = "EXISTS\r\n"
@@ -13,6 +24,14 @@ module Response
attr_reader :addresses
+ # Creates a new MemCacheStore object, with the given memcached server
+ # addresses. Each address is either a host name, or a host-with-port string
+ # in the form of "host_name:port". For example:
+ #
+ # ActiveSupport::Cache::MemCacheStore.new("localhost", "server-downstairs.localnetwork:8229")
+ #
+ # If no addresses are specified, then MemCacheStore will connect to
+ # localhost port 11211 (the default memcached port).
def initialize(*addresses)
addresses = addresses.flatten
options = addresses.extract_options!
@@ -21,7 +40,7 @@ def initialize(*addresses)
@data = MemCache.new(addresses, options)
end
- def read(key, options = nil)
+ def read(key, options = nil) # :nodoc:
super
@data.get(key, raw?(options))
rescue MemCache::MemCacheError => e
@@ -29,8 +48,13 @@ def read(key, options = nil)
nil
end
- # Set key = value. Pass :unless_exist => true if you don't
- # want to update the cache if the key is already set.
+ # Writes a value to the cache.
+ #
+ # Possible options:
+ # - +:unless_exist+ - set to true if you don't want to update the cache
+ # if the key is already set.
+ # - +:expires_in+ - the number of seconds that this value may stay in
+ # the cache. See ActiveSupport::Cache::Store#write for an example.
def write(key, value, options = nil)
super
method = options && options[:unless_exist] ? :add : :set
@@ -44,7 +68,7 @@ def write(key, value, options = nil)
false
end
- def delete(key, options = nil)
+ def delete(key, options = nil) # :nodoc:
super
response = @data.delete(key, expires_in(options))
response == Response::DELETED
@@ -53,13 +77,13 @@ def delete(key, options = nil)
false
end
- def exist?(key, options = nil)
+ def exist?(key, options = nil) # :nodoc:
# Doesn't call super, cause exist? in memcache is in fact a read
# But who cares? Reading is very fast anyway
!read(key, options).nil?
end
- def increment(key, amount = 1)
+ def increment(key, amount = 1) # :nodoc:
log("incrementing", key, amount)
response = @data.incr(key, amount)
@@ -68,7 +92,7 @@ def increment(key, amount = 1)
nil
end
- def decrement(key, amount = 1)
+ def decrement(key, amount = 1) # :nodoc:
log("decrement", key, amount)
response = @data.decr(key, amount)
@@ -77,7 +101,7 @@ def decrement(key, amount = 1)
nil
end
- def delete_matched(matcher, options = nil)
+ def delete_matched(matcher, options = nil) # :nodoc:
super
raise "Not supported by Memcache"
end
View
14 activesupport/lib/active_support/cache/memory_store.rb
@@ -1,5 +1,19 @@
module ActiveSupport
module Cache
+ # A cache store implementation which stores everything into memory in the
+ # same process. If you're running multiple Ruby on Rails server processes
+ # (which is the case if you're using mongrel_cluster or Phusion Passenger),
+ # then this means that your Rails server process instances won't be able
+ # to share cache data with each other. If your application never performs
+ # manual cache item expiry (e.g. when you're using generational cache keys),
+ # then using MemoryStore is ok. Otherwise, consider carefully whether you
+ # should be using this cache store.
+ #
+ # MemoryStore is not only able to store strings, but also arbitrary Ruby
+ # objects.
+ #
+ # MemoryStore is not thread-safe. Use SynchronizedMemoryStore instead
+ # if you need thread-safety.
class MemoryStore < Store
def initialize
@data = {}
View
1  activesupport/lib/active_support/cache/synchronized_memory_store.rb
@@ -1,5 +1,6 @@
module ActiveSupport
module Cache
+ # Like MemoryStore, but thread-safe.
class SynchronizedMemoryStore < MemoryStore
def initialize
super
View
2  activesupport/lib/active_support/testing/performance.rb
@@ -124,7 +124,7 @@ def record
def environment
unless defined? @env
- app = "#{$1}.#{$2}" if `git branch -v` =~ /^\* (\S+)\s+(\S+)/
+ app = "#{$1}.#{$2}" if File.directory?('.git') && `git branch -v` =~ /^\* (\S+)\s+(\S+)/
rails = Rails::VERSION::STRING
if File.directory?('vendor/rails/.git')
View
68 railties/doc/guides/html/2_2_release_notes.html
@@ -337,72 +337,72 @@ <h2 id="_documentation">2. Documentation</h2>
<div class="ilist"><ul>
<li>
<p>
-Getting Started with Rails
+<a href="http://guides.rubyonrails.org/getting_started_with_rails.html">Getting Started with Rails</a>
</p>
</li>
<li>
<p>
-Rails Database Migrations
+<a href="http://guides.rubyonrails.org/migrations.html">Rails Database Migrations</a>
</p>
</li>
<li>
<p>
-Active Record Associations
+<a href="http://guides.rubyonrails.org/association_basics.html">Active Record Associations</a>
</p>
</li>
<li>
<p>
-Active Record Finders
+<a href="http://guides.rubyonrails.org/finders.html">Active Record Finders</a>
</p>
</li>
<li>
<p>
-Layouts and Rendering in Rails
+<a href="http://guides.rubyonrails.org/layouts_and_rendering.html">Layouts and Rendering in Rails</a>
</p>
</li>
<li>
<p>
-Action View Form Helpers
+<a href="http://guides.rubyonrails.org/form_helpers.html">Action View Form Helpers</a>
</p>
</li>
<li>
<p>
-Rails Routing from the Outside In
+<a href="http://guides.rubyonrails.org/routing_outside_in.html">Rails Routing from the Outside In</a>
</p>
</li>
<li>
<p>
-Basics of Action Controller
+<a href="http://guides.rubyonrails.org/actioncontroller_basics.html">Basics of Action Controller</a>
</p>
</li>
<li>
<p>
-Rails Caching
+<a href="http://guides.rubyonrails.org/caching_with_rails.html">Rails Caching</a>
</p>
</li>
<li>
<p>
-Testing Rails Applications
+<a href="http://guides.rubyonrails.org/testing_rails_applications.html">Testing Rails Applications</a>
</p>
</li>
<li>
<p>
-Securing Rails Applications
+<a href="http://guides.rubyonrails.org/security.html">Securing Rails Applications</a>
</p>
</li>
<li>
<p>
-Debugging Rails Applications
+<a href="http://guides.rubyonrails.org/debugging_rails_applications.html">Debugging Rails Applications</a>
</p>
</li>
<li>
<p>
-Benchmarking and Profiling Rails Applications
+<a href="http://guides.rubyonrails.org/benchmarking_and_profiling.html">Benchmarking and Profiling Rails Applications</a>
</p>
</li>
<li>
<p>
-The Basics of Creating Rails Plugins
+<a href="http://guides.rubyonrails.org/creating_plugins.html">The Basics of Creating Rails Plugins</a>
</p>
</li>
</ul></div>
@@ -612,7 +612,7 @@ <h3 id="_hashes_for_join_table_conditions">5.3. Hashes for Join Table Conditions
</ul></div>
<h3 id="_new_dynamic_finders">5.4. New Dynamic Finders</h3>
<div class="para"><p>Two new sets of methods have been added to Active Record's dynamic finders family.</p></div>
-<h4 id="_find_last_by_lt_attributes_gt">5.4.1. find_last_by_&lt;attributes&gt;</h4>
+<h4 id="_tt_find_last_by_lt_attribute_gt_tt">5.4.1. <tt>find_last_by_&lt;attribute&gt;</tt></h4>
<div class="para"><p>The <tt>find_last_by_&lt;attribute&gt;</tt> method is equivalent to <tt>Model.last(:conditions &#8658; {:attribute &#8658; value})</tt></p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
@@ -629,8 +629,8 @@ <h4 id="_find_last_by_lt_attributes_gt">5.4.1. find_last_by_&lt;attributes&gt;</
</p>
</li>
</ul></div>
-<h4 id="_find_by_lt_attributes_gt">5.4.2. find_by_&lt;attributes&gt;!</h4>
-<div class="para"><p>The new bang! version of <tt>find_by_&lt;attribute&gt;! is equivalent to +Model.first(:conditions &#8658; {:attribute &#8658; value}) || raise ActiveRecord::RecordNotFound</tt> Instead of returning <tt>nil</tt> if it can't find a matching record, this method will raise an exception if it cannot find a match.</p></div>
+<h4 id="_tt_find_by_lt_attribute_gt_tt">5.4.2. <tt>find_by_&lt;attribute&gt;!</tt></h4>
+<div class="para"><p>The new bang! version of <tt>find_by_&lt;attribute&gt;!</tt> is equivalent to <tt>Model.first(:conditions &#8658; {:attribute &#8658; value}) || raise ActiveRecord::RecordNotFound</tt> Instead of returning <tt>nil</tt> if it can't find a matching record, this method will raise an exception if it cannot find a match.</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
@@ -779,6 +779,16 @@ <h3 id="_other_action_controller_changes">6.3. Other Action Controller Changes</
Rails now supports HTTP-only cookies (and uses them for sessions), which help mitigate some cross-site scripting risks in newer browsers.
</p>
</li>
+<li>
+<p>
+<tt>redirect_to</tt> now fully supports URI schemes (so, for example, you can redirect to a svn+ssh: URI).
+</p>
+</li>
+<li>
+<p>
+<tt>render</tt> now supports a <tt>:js</tt> option to render plain vanilla javascript with the right mime type.
+</p>
+</li>
</ul></div>
</div>
<h2 id="_action_view">7. Action View</h2>
@@ -791,7 +801,7 @@ <h2 id="_action_view">7. Action View</h2>
</li>
<li>
<p>
-The included Prototype javascript library has been upgraded to version 1.6.0.2.
+The included Prototype javascript library has been upgraded to version 1.6.0.3.
</p>
</li>
<li>
@@ -893,23 +903,23 @@ <h3 id="_delegates_with_prefixes">9.3. Delegates With Prefixes</h3>
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Vendor <span style="color: #990000">&lt;&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Vendor <span style="color: #990000">&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
has_one <span style="color: #990000">:</span>account
delegate <span style="color: #990000">:</span>email<span style="color: #990000">,</span> <span style="color: #990000">:</span>password<span style="color: #990000">,</span> <span style="color: #990000">:</span>to <span style="color: #990000">=&gt;</span> <span style="color: #990000">:</span>account<span style="color: #990000">,</span> <span style="color: #990000">:</span>prefix <span style="color: #990000">=&gt;</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
-<div class="para"><p>This will produce delegated methods <tt>vendor.account_email</tt> and <tt>vendor.account_password</tt>. You can also specify a custom prefix:</p></div>
+<div class="para"><p>This will produce delegated methods <tt>vendor#account_email</tt> and <tt>vendor#account_password</tt>. You can also specify a custom prefix:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Vendor <span style="color: #990000">&lt;&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Vendor <span style="color: #990000">&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
has_one <span style="color: #990000">:</span>account
delegate <span style="color: #990000">:</span>email<span style="color: #990000">,</span> <span style="color: #990000">:</span>password<span style="color: #990000">,</span> <span style="color: #990000">:</span>to <span style="color: #990000">=&gt;</span> <span style="color: #990000">:</span>account<span style="color: #990000">,</span> <span style="color: #990000">:</span>prefix <span style="color: #990000">=&gt;</span> <span style="color: #990000">:</span>owner
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
-<div class="para"><p>This will produce delegated methods <tt>vendor.owner_email</tt> and <tt>vendor.owner_password</tt>.</p></div>
+<div class="para"><p>This will produce delegated methods <tt>vendor#owner_email</tt> and <tt>vendor#owner_password</tt>.</p></div>
<div class="para"><p>Lead Contributor: <a href="http://workingwithrails.com/person/5830-daniel-schierbeck">Daniel Schierbeck</a></p></div>
<h3 id="_other_active_support_changes">9.4. Other Active Support Changes</h3>
<div class="ilist"><ul>
@@ -953,6 +963,11 @@ <h3 id="_other_active_support_changes">9.4. Other Active Support Changes</h3>
The included TzInfo library has been upgraded to version 0.3.11.
</p>
</li>
+<li>
+<p>
+<tt>ActiveSuport::StringInquirer</tt> gives you a pretty way to test for equality in strings: <tt>ActiveSupport::StringInquirer.new("abc").abc? &#8658; true</tt>
+</p>
+</li>
</ul></div>
</div>
<h2 id="_railties">10. Railties</h2>
@@ -997,7 +1012,7 @@ <h3 id="_tt_config_gems_tt">10.1. <tt>config.gems</tt></h3>
</p>
</li>
</ul></div>
-<div class="para"><p>You can unpack or install a single gem by specifying <tt>GEM=_gem_name</tt> on the command line.</p></div>
+<div class="para"><p>You can unpack or install a single gem by specifying <tt>GEM=<em>gem_name</em></tt> on the command line.</p></div>
<div class="ilist"><ul>
<li>
<p>
@@ -1014,6 +1029,11 @@ <h3 id="_tt_config_gems_tt">10.1. <tt>config.gems</tt></h3>
<a href="http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies">What's New in Edge Rails: Gem Dependencies</a>
</p>
</li>
+<li>
+<p>
+<a href="http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/">Rails 2.1.2 and 2.2RC1: Update Your RubyGems</a>
+</p>
+</li>
</ul></div>
</li>
</ul></div>
@@ -1046,7 +1066,7 @@ <h3 id="_other_railties_changes">10.2. Other Railties Changes</h3>
</li>
<li>
<p>
-Wrapped <tt>Rails.env</tt> in <tt>StringQuestioneer</tt> so you can do <tt>Rails.env.development?</tt>
+Wrapped <tt>Rails.env</tt> in <tt>StringInquirer</tt> so you can do <tt>Rails.env.development?</tt>
</p>
</li>
<li>
View
1  railties/doc/guides/html/actioncontroller_basics.html
@@ -693,7 +693,6 @@ <h2 id="_filters">6. Filters</h2>
<div class="para"><p>Now, the LoginsController's "new" and "create" actions will work as before without requiring the user to be logged in. The <tt>:only</tt> option is used to only skip this filter for these actions, and there is also an <tt>:except</tt> option which works the other way. These options can be used when adding filters too, so you can add a filter which only runs for selected actions in the first place.</p></div>
<h3 id="_after_filters_and_around_filters">6.1. After filters and around filters</h3>
<div class="para"><p>In addition to the before filters, you can run filters after an action has run or both before and after. The after filter is similar to the before filter, but because the action has already been run it has access to the response data that's about to be sent to the client. Obviously, after filters can not stop the action from running. Around filters are responsible for running the action, but they can choose not to, which is the around filter's way of stopping it.</p></div>
-<div class="para"><p>TODO: Find a real example for an around filter</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
View
10 railties/doc/guides/html/association_basics.html
@@ -691,7 +691,7 @@ <h3 id="_self_joins">2.10. Self Joins</h3>
belongs_to <span style="color: #990000">:</span>manager<span style="color: #990000">,</span> <span style="color: #990000">:</span>class_name <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">"User"</span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
-<div class="para"><p>With this setup, you can retrieve <tt>@employee.subordinates</tt> and <tt>@employee.managers</tt>.</p></div>
+<div class="para"><p>With this setup, you can retrieve <tt>@employee.subordinates</tt> and <tt>@employee.manager</tt>.</p></div>
</div>
<h2 id="_tips_tricks_and_warnings">3. Tips, Tricks, and Warnings</h2>
<div class="sectionbody">
@@ -1185,6 +1185,14 @@ <h5 id="_tt_readonly_tt"><tt>:readonly</tt></h5>
<div class="para"><p>If you set the <tt>:readonly</tt> option to <tt>true</tt>, then the associated object will be read-only when retrieved via the association.</p></div>
<h5 id="_tt_select_tt"><tt>:select</tt></h5>
<div class="para"><p>The <tt>:select</tt> option lets you override the SQL <tt>SELECT</tt> clause that is used to retrieve data about the associated object. By default, Rails retrieves all columns.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<img src="./images/icons/tip.png" alt="Tip" />
+</td>
+<td class="content">If you set the <tt>:select</tt> option on a <tt>belongs_to</tt> association, you should also set the <tt>foreign_key</tt> option to guarantee the correct results.</td>
+</tr></table>
+</div>
<h5 id="_tt_validate_tt"><tt>:validate</tt></h5>
<div class="para"><p>If you set the <tt>:validate</tt> option to <tt>true</tt>, then associated objects will be validated whenever you save this object. By default, this is <tt>false</tt>: associated objects will not be validated when this object is saved.</p></div>
<h4 id="_when_are_objects_saved">4.1.3. When are Objects Saved?</h4>
View
653 railties/doc/guides/html/finders.html
343 additions, 310 deletions not shown
View
5 railties/doc/guides/html/getting_started_with_rails.html
@@ -2010,6 +2010,11 @@ <h2 id="_changelog">10. Changelog</h2>
<div class="ilist"><ul>
<li>
<p>
+November 1, 2008: First approved version by <a href="../authors.html#mgunderloy">Mike Gunderloy</a>
+</p>
+</li>
+<li>
+<p>
October 16, 2008: Revised based on feedback from Pratik Naik by <a href="../authors.html#mgunderloy">Mike Gunderloy</a> (not yet approved for publication)
</p>
</li>
View
16 railties/doc/guides/html/index.html
@@ -219,14 +219,6 @@ <h2 id="site_title_tagline">Sustainable productivity for web-application develop
<div class="sidebarblock">
<div class="sidebar-content">
<div class="sidebar-title"><a href="getting_started_with_rails.html">Getting Started with Rails</a></div>
-<div class="admonitionblock">
-<table><tr>
-<td class="icon">
-<img src="./images/icons/caution.png" alt="Caution" />
-</td>
-<td class="content"><a href="http://rails.lighthouseapp.com/projects/16213/tickets/2">Lighthouse Ticket</a></td>
-</tr></table>
-</div>
<div class="para"><p>Everything you need to know to install Rails and create your first application.</p></div>
</div></div>
<h2>Models</h2>
@@ -326,14 +318,6 @@ <h2 id="site_title_tagline">Sustainable productivity for web-application develop
<div class="sidebarblock">
<div class="sidebar-content">
<div class="sidebar-title"><a href="security.html">Securing Rails Applications</a></div>
-<div class="admonitionblock">
-<table><tr>
-<td class="icon">
-<img src="./images/icons/caution.png" alt="Caution" />
-</td>
-<td class="content"><a href="http://rails.lighthouseapp.com/projects/16213/tickets/7">Lighthouse Ticket</a></td>
-</tr></table>
-</div>
<div class="para"><p>This manual describes common security problems in web applications and how to
avoid them with Rails.</p></div>
</div></div>
View
158 railties/doc/guides/html/layouts_and_rendering.html
@@ -489,7 +489,17 @@ <h4 id="_rendering_xml">2.2.9. Rendering XML</h4>
<td class="content">You don't need to call <tt>to_xml</tt> on the object that you want to render. If you use the <tt>:xml</tt> option, <tt>render</tt> will automatically call <tt>to_xml</tt> for you.</td>
</tr></table>
</div>
-<h4 id="_options_for_tt_render_tt">2.2.10. Options for <tt>render</tt></h4>
+<h4 id="_rendering_vanilla_javascript">2.2.10. Rendering Vanilla JavaScript</h4>
+<div class="para"><p>Rails can render vanilla JavaScript (as an alternative to using <tt>update</tt> with n <tt>.rjs</tt> file):</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>render <span style="color: #990000">:</span>js <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">"alert('Hello Rails');"</span>
+</tt></pre></div></div>
+<div class="para"><p>This will send the supplied string to the browser with a MIME type of <tt>text/javascript</tt>.</p></div>
+<h4 id="_options_for_tt_render_tt">2.2.11. Options for <tt>render</tt></h4>
<div class="para"><p>Calls to the <tt>render</tt> method generally accept four options:</p></div>
<div class="ilist"><ul>
<li>
@@ -560,7 +570,7 @@ <h5 id="_the_tt_location_tt_option">The <tt>:location</tt> Option</h5>
http://www.gnu.org/software/src-highlite -->
<pre><tt>render <span style="color: #990000">:</span>xml <span style="color: #990000">=&gt;</span> photo<span style="color: #990000">,</span> <span style="color: #990000">:</span>location <span style="color: #990000">=&gt;</span> photo_url<span style="color: #990000">(</span>photo<span style="color: #990000">)</span>
</tt></pre></div></div>
-<h4 id="_finding_layouts">2.2.11. Finding Layouts</h4>
+<h4 id="_finding_layouts">2.2.12. Finding Layouts</h4>
<div class="para"><p>To find the current layout, Rails first looks for a file in <tt>app/views/layouts</tt> with the same base name as the controller. For example, rendering actions from the <tt>PhotosController</tt> class will use <tt>/app/views/layouts/photos.html.erb</tt>. If there is no such controller-specific layout, Rails will use <tt>/app/views/layouts/application.html.erb</tt>. If there is no <tt>.erb</tt> layout, Rails will use a <tt>.builder</tt> layout if one exists. Rails also provides several ways to more precisely assign specific layouts to individual controllers and actions.</p></div>
<h5 id="_specifying_layouts_on_a_per_controller_basis">Specifying Layouts on a per-Controller Basis</h5>
<div class="para"><p>You can override the automatic layout conventions in your controllers by using the <tt>layout</tt> declaration in the controller. For example:</p></div>
@@ -632,6 +642,7 @@ <h5 id="_conditional_layouts">Conditional Layouts</h5>
<div class="para"><p>With those declarations, the <tt>inventory</tt> layout would be used only for the <tt>index</tt> method, the <tt>product</tt> layout would be used for everything else except the <tt>rss</tt> method, and the <tt>rss</tt> method will have its layout determined by the automatic layout rules.</p></div>
<h5 id="_layout_inheritance">Layout Inheritance</h5>
<div class="para"><p>Layouts are shared downwards in the hierarchy, and more specific layouts always override more general ones. For example:</p></div>
+<div class="para"><p><tt>application.rb</tt>:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
@@ -641,17 +652,35 @@ <h5 id="_layout_inheritance">Layout Inheritance</h5>
layout <span style="color: #FF0000">"main"</span>
<span style="font-style: italic"><span style="color: #9A1900">#...</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
-
-<span style="font-weight: bold"><span style="color: #0000FF">class</span></span> PostsController <span style="color: #990000">&lt;</span> ApplicationController
+</tt></pre></div></div>
+<div class="para"><p><tt>posts_controller.rb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> PostsController <span style="color: #990000">&lt;</span> ApplicationController
<span style="font-style: italic"><span style="color: #9A1900"># ...</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
-
-<span style="font-weight: bold"><span style="color: #0000FF">class</span></span> SpecialPostsController <span style="color: #990000">&lt;</span> PostsController
+</tt></pre></div></div>
+<div class="para"><p><tt>special_posts_controller.rb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> SpecialPostsController <span style="color: #990000">&lt;</span> PostsController
layout <span style="color: #FF0000">"special"</span>
<span style="font-style: italic"><span style="color: #9A1900"># ...</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
-
-<span style="font-weight: bold"><span style="color: #0000FF">class</span></span> OldPostsController <span style="color: #990000">&lt;</span> SpecialPostsController
+</tt></pre></div></div>
+<div class="para"><p><tt>old_posts_controller.rb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> OldPostsController <span style="color: #990000">&lt;</span> SpecialPostsController
layout <span style="font-weight: bold"><span style="color: #0000FF">nil</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">def</span></span> show
@@ -693,7 +722,7 @@ <h5 id="_layout_inheritance">Layout Inheritance</h5>
</p>
</li>
</ul></div>
-<h4 id="_avoiding_double_render_errors">2.2.12. Avoiding Double Render Errors</h4>
+<h4 id="_avoiding_double_render_errors">2.2.13. Avoiding Double Render Errors</h4>
<div class="para"><p>Sooner or later, most Rails developers will see the error message "Can only render or redirect once per action". While this is annoying, it's relatively easy to fix. Usually it happens because of a fundamental misunderstanding of the way that <tt>render</tt> works.</p></div>
<div class="para"><p>For example, here's some code that will trigger this error:</p></div>
<div class="listingblock">
@@ -933,7 +962,7 @@ <h4 id="_linking_to_javascript_files_with_tt_javascript_include_tag_tt">3.1.2. L
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #FF0000">&lt;%= javascript_include_tag :all, :recursive %&gt;</span>
+<pre><tt><span style="color: #FF0000">&lt;%= javascript_include_tag :all, :recursive =&gt;</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span> <span style="color: #990000">%&gt;</span>
</tt></pre></div></div>
<div class="para"><p>If you're loading multiple javascript files, you can create a better user experience by combining multiple files into a single download. To make this happen in production, specify <tt>:cache &#8658; true</tt> in your <tt>javascript_include_tag</tt>:</p></div>
<div class="listingblock">
@@ -1007,7 +1036,7 @@ <h4 id="_linking_to_css_files_with_tt_stylesheet_link_tag_tt">3.1.3. Linking to
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #FF0000">&lt;%= stylesheet_link_tag :all, :recursive %&gt;</span>
+<pre><tt><span style="color: #FF0000">&lt;%= stylesheet_link_tag :all, :recursive =&gt;</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span> <span style="color: #990000">%&gt;</span>
</tt></pre></div></div>
<div class="para"><p>If you're loading multiple CSS files, you can create a better user experience by combining multiple files into a single download. To make this happen in production, specify <tt>:cache &#8658; true</tt> in your <tt>stylesheet_link_tag</tt>:</p></div>
<div class="listingblock">
@@ -1185,26 +1214,33 @@ <h4 id="_partial_layouts">3.4.3. Partial Layouts</h4>
<div class="para"><p>This would look for a partial named <tt>_link_area.html.erb</tt> and render it using the layout <tt>_graybar.html.erb</tt>. Note that layouts for partials follow the same leading-underscore naming as regular partials, and are placed in the same folder with the partial that they belong to (not in the master <tt>layouts</tt> folder).</p></div>
<h4 id="_passing_local_variables">3.4.4. Passing Local Variables</h4>
<div class="para"><p>You can also pass local variables into partials, making them even more powerful and flexible. For example, you can use this technique to reduce duplication between new and edit pages, while still keeping a bit of distinct content:</p></div>
+<div class="para"><p><tt>new.html.erb</tt>:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>new.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>New zone<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>New zone<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
&lt;%= error_messages_for :zone %&gt;
&lt;%= render :partial =&gt; "form", :locals =&gt; { :button_label =&gt; "Create zone", :zone =&gt; @zone } %&gt;
-
-edit.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Editing zone<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
+</tt></pre></div></div>
+<div class="para"><p><tt>edit.html.erb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Editing zone<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
&lt;%= error_messages_for :zone %&gt;
&lt;%= render :partial =&gt; "form", :locals =&gt; { :button_label =&gt; "Update zone", :zone =&gt; @zone } %&gt;
-
-_form.html.erb:
-
-&lt;% form_for(@zone) do |f| %&gt;
+</tt></pre></div></div>
+<div class="para"><p><tt>_form.html.erb:</tt></p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>&lt;% form_for(zone) do |f| %&gt;
<span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">&lt;b&gt;</span></span>Zone name<span style="font-weight: bold"><span style="color: #0000FF">&lt;/b&gt;&lt;br</span></span> <span style="font-weight: bold"><span style="color: #0000FF">/&gt;</span></span>
&lt;%= f.text_field :name %&gt;
@@ -1215,7 +1251,7 @@ <h4 id="_passing_local_variables">3.4.4. Passing Local Variables</h4>
&lt;% end %&gt;
</tt></pre></div></div>
<div class="para"><p>Although the same partial will be rendered into both views, the label on the submit button is controlled by a local variable passed into the partial.</p></div>
-<div class="para"><p>Every partial also has a local variable with the same name as the partial (minus the underscore). By default, it will look for an instance variable with the same name as the partial in the parent. You can pass an object in to this local variable via the <tt>:object</tt> option:</p></div>
+<div class="para"><p>Every partial also has a local variable with the same name as the partial (minus the underscore). You can pass an object in to this local variable via the <tt>:object</tt> option:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
@@ -1224,6 +1260,14 @@ <h4 id="_passing_local_variables">3.4.4. Passing Local Variables</h4>
<pre><tt>&lt;%= render :partial =&gt; "customer", :object =&gt; @new_customer %&gt;
</tt></pre></div></div>
<div class="para"><p>Within the <tt>customer</tt> partial, the <tt>@customer</tt> variable will refer to <tt>@new_customer</tt> from the parent view.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<img src="./images/icons/warning.png" alt="Warning" />
+</td>
+<td class="content">In previous versions of Rails, the default local variable would look for an instance variable with the same name as the partial in the parent. This behavior is deprecated in Rails 2.2 and will be removed in a future version.</td>
+</tr></table>
+</div>
<div class="para"><p>If you have an instance of a model to render into a partial, you can use a shorthand syntax:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
@@ -1235,19 +1279,22 @@ <h4 id="_passing_local_variables">3.4.4. Passing Local Variables</h4>
<div class="para"><p>Assuming that the <tt>@customer</tt> instance variable contains an instance of the <tt>Customer</tt> model, this will use <tt>_customer.html.erb</tt> to render it.</p></div>
<h4 id="_rendering_collections">3.4.5. Rendering Collections</h4>
<div class="para"><p>Partials are very useful in rendering collections. When you pass a collection to a partial via the <tt>:collection</tt> option, the partial will be inserted once for each member in the collection:</p></div>
+<div class="para"><p><tt>index.html.erb</tt>:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>index.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Products<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Products<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
&lt;%= render :partial =&gt; "product", :collection =&gt; @products %&gt;
-
-_product.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Product Name: &lt;%= product.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
+</tt></pre></div></div>
+<div class="para"><p><tt>_product.html.erb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Product Name: &lt;%= product.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
</tt></pre></div></div>
<div class="para"><p>When a partial is called with a pluralized collection, then the individual instances of the partial have access to the member of the collection being rendered via a variable named after the partial. In this case, the partial is <tt>_product, and within the +_product</tt> partial, you can refer to <tt>product</tt> to get the instance that is being rendered. To use a custom local variable name within the partial, specify the <tt>:as</tt> option in the call to the partial:</p></div>
<div class="listingblock">
@@ -1268,38 +1315,48 @@ <h4 id="_rendering_collections">3.4.5. Rendering Collections</h4>
</tt></pre></div></div>
<div class="para"><p>Rails will render the <tt>_product_ruler</tt> partial (with no data passed in to it) between each pair of <tt>_product</tt> partials.</p></div>
<div class="para"><p>There's also a shorthand syntax available for rendering collections. For example, if <tt>@products</tt> is a collection of products, you can render the collection this way:</p></div>
+<div class="para"><p><tt>index.html.erb</tt>:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>index.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Products<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Products<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
&lt;%= render :partial =&gt; @products %&gt;
-
-_product.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Product Name: &lt;%= product.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
+</tt></pre></div></div>
+<div class="para"><p><tt>_product.html.erb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Product Name: &lt;%= product.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
</tt></pre></div></div>
<div class="para"><p>Rails determines the name of the partial to use by looking at the model name in the collection. In fact, you can even create a heterogeneous collection and render it this way, and Rails will choose the proper partial for each member of the collection:</p></div>
+<div class="para"><p><tt>index.html.erb</tt>:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>index.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Contacts<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h1&gt;</span></span>Contacts<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h1&gt;</span></span>
&lt;%= render :partial =&gt; [customer1, employee1, customer2, employee2] %&gt;
-
-_customer.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Name: &lt;%= customer.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
-
-_employee.html.erb:
-
-<span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Name: &lt;%= employee.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
+</tt></pre></div></div>
+<div class="para"><p><tt>_customer.html.erb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Name: &lt;%= customer.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
+</tt></pre></div></div>
+<div class="para"><p><tt>_employee.html.erb</tt>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 2.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;p&gt;</span></span>Name: &lt;%= employee.name %&gt;<span style="font-weight: bold"><span style="color: #0000FF">&lt;/p&gt;</span></span>
</tt></pre></div></div>
<div class="para"><p>In this case, Rails will use the customer or employee partials as appropriate for each member of the collection.</p></div>
</div>
@@ -1309,6 +1366,11 @@ <h2 id="_changelog">4. Changelog</h2>
<div class="ilist"><ul>
<li>
<p>
+November 1, 2008: Added <tt>:js</tt> option for <tt>render</tt> by <a href="../authors.html#mgunderloy">Mike Gunderloy</a>
+</p>
+</li>
+<li>
+<p>
October 16, 2008: Ready for publication by <a href="../authors.html#mgunderloy">Mike Gunderloy</a>
</p>
</li>
View
2  railties/doc/guides/html/routing_outside_in.html
@@ -1756,7 +1756,7 @@ <h3 id="_namespaced_resources">3.10. Namespaced Resources</h3>
<span style="color: #990000">:</span>has_many <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">{</span> <span style="color: #990000">:</span>tags<span style="color: #990000">,</span> <span style="color: #990000">:</span>ratings<span style="color: #FF0000">}</span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
-<div class="para"><p>As you can see, the namespaced version is much more succinct than the one that spells everything out - but it still creates the same routes. For example, you'll get <tt>admin_photos_url</tt> that expects to find an <tt>Admin::PhotosController</tt> and that matches <tt>admin/photos</tt>, and <tt>admin_photos_ratings+path</tt> that matches <tt>/admin/photos/<em>photo_id</em>/ratings</tt>, expecting to use <tt>Admin::RatingsController</tt>. Even though you're not specifying <tt>path_prefix</tt> explicitly, the routing code will calculate the appropriate <tt>path_prefix</tt> from the route nesting.</p></div>
+<div class="para"><p>As you can see, the namespaced version is much more succinct than the one that spells everything out - but it still creates the same routes. For example, you'll get <tt>admin_photos_url</tt> that expects to find an <tt>Admin::PhotosController</tt> and that matches <tt>admin/photos</tt>, and <tt>admin_photos_ratings_path</tt> that matches <tt>/admin/photos/<em>photo_id</em>/ratings</tt>, expecting to use <tt>Admin::RatingsController</tt>. Even though you're not specifying <tt>path_prefix</tt> explicitly, the routing code will calculate the appropriate <tt>path_prefix</tt> from the route nesting.</p></div>
<h3 id="_adding_more_restful_actions">3.11. Adding More RESTful Actions</h3>
<div class="para"><p>You are not limited to the seven routes that RESTful routing creates by default. If you like, you may add additional member routes (those which apply to a single instance of the resource), additional new routes (those that apply to creating a new resource), or additional collection routes (those which apply to the collection of resources as a whole).</p></div>
<h4 id="_adding_member_routes">3.11.1. Adding Member Routes</h4>
View
14 railties/doc/guides/html/security.html
@@ -310,6 +310,9 @@ <h2 id="site_title_tagline">Sustainable productivity for web-application develop
<li>
<a href="#_additional_resources">Additional resources</a>
</li>
+ <li>
+ <a href="#_changelog">Changelog</a>
+ </li>
</ol>
</div>
@@ -1325,6 +1328,17 @@ <h2 id="_additional_resources">9. Additional resources</h2>
</li>
</ul></div>
</div>
+<h2 id="_changelog">10. Changelog</h2>
+<div class="sectionbody">
+<div class="para"><p><a href="http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/7">Lighthouse ticket</a></p></div>
+<div class="ilist"><ul>
+<li>
+<p>
+November 1, 2008: First approved version by Heiko Webers
+</p>
+</li>
+</ul></div>
+</div>
</div>
</div>
View
52 railties/doc/guides/source/2_2_release_notes.txt
@@ -27,20 +27,20 @@ Along with thread safety, a lot of work has been done to make Rails work well wi
The internal documentation of Rails, in the form of code comments, has been improved in numerous places. In addition, the link:http://guides.rubyonrails.org/[Ruby on Rails Guides] project is the definitive source for information on major Rails components. In its first official release, the Guides page includes:
-* Getting Started with Rails
-* Rails Database Migrations
-* Active Record Associations
-* Active Record Finders
-* Layouts and Rendering in Rails
-* Action View Form Helpers
-* Rails Routing from the Outside In
-* Basics of Action Controller
-* Rails Caching
-* Testing Rails Applications
-* Securing Rails Applications
-* Debugging Rails Applications
-* Benchmarking and Profiling Rails Applications
-* The Basics of Creating Rails Plugins
+* link:http://guides.rubyonrails.org/getting_started_with_rails.html[Getting Started with Rails]
+* link:http://guides.rubyonrails.org/migrations.html[Rails Database Migrations]
+* link:http://guides.rubyonrails.org/association_basics.html[Active Record Associations]
+* link:http://guides.rubyonrails.org/finders.html[Active Record Finders]
+* link:http://guides.rubyonrails.org/layouts_and_rendering.html[Layouts and Rendering in Rails]
+* link:http://guides.rubyonrails.org/form_helpers.html[Action View Form Helpers]
+* link:http://guides.rubyonrails.org/routing_outside_in.html[Rails Routing from the Outside In]
+* link:http://guides.rubyonrails.org/actioncontroller_basics.html[Basics of Action Controller]
+* link:http://guides.rubyonrails.org/caching_with_rails.html[Rails Caching]
+* link:http://guides.rubyonrails.org/testing_rails_applications.html[Testing Rails Applications]
+* link:http://guides.rubyonrails.org/security.html[Securing Rails Applications]
+* link:http://guides.rubyonrails.org/debugging_rails_applications.html[Debugging Rails Applications]
+* link:http://guides.rubyonrails.org/benchmarking_and_profiling.html[Benchmarking and Profiling Rails Applications]
+* link:http://guides.rubyonrails.org/creating_plugins.html[The Basics of Creating Rails Plugins]
All told, the Guides provide tens of thousands of words of guidance for beginning and intermediate Rails developers.
@@ -167,7 +167,7 @@ Product.all(:joins => :photos, :conditions => { :photos => { :copyright => false
Two new sets of methods have been added to Active Record's dynamic finders family.
-==== find_last_by_<attributes>
+==== +find_last_by_<attribute>+
The +find_last_by_<attribute>+ method is equivalent to +Model.last(:conditions => {:attribute => value})+
@@ -179,9 +179,9 @@ User.find_last_by_city('London')
* Lead Contributor: link:http://www.workingwithrails.com/person/9147-emilio-tagua[Emilio Tagua]
-==== find_by_<attributes>!
+==== +find_by_<attribute>!+
-The new bang! version of +find_by_<attribute>! is equivalent to +Model.first(:conditions => {:attribute => value}) || raise ActiveRecord::RecordNotFound+ Instead of returning +nil+ if it can't find a matching record, this method will raise an exception if it cannot find a match.
+The new bang! version of +find_by_<attribute>!+ is equivalent to +Model.first(:conditions => {:attribute => value}) || raise ActiveRecord::RecordNotFound+ Instead of returning +nil+ if it can't find a matching record, this method will raise an exception if it cannot find a match.
[source, ruby]
-------------------------------------------------------
@@ -257,11 +257,13 @@ Action Controller now offers good support for HTTP conditional GET requests, as
* The HTTP Accept header is disabled by default now. You should prefer the use of formatted URLs (such as +/customers/1.xml+) to indicate the format that you want. If you need the Accept headers, you can turn them back on with +config.action_controller.user_accept_header = true+.
* Benchmarking numbers are now reported in milliseconds rather than tiny fractions of seconds
* Rails now supports HTTP-only cookies (and uses them for sessions), which help mitigate some cross-site scripting risks in newer browsers.
+* +redirect_to+ now fully supports URI schemes (so, for example, you can redirect to a svn+ssh: URI).
+* +render+ now supports a +:js+ option to render plain vanilla javascript with the right mime type.
== Action View
* +javascript_include_tag+ and +stylesheet_link_tag+ support a new +:recursive+ option to be used along with +:all+, so that you can load an entire tree of files with a single line of code.
-* The included Prototype javascript library has been upgraded to version 1.6.0.2.
+* The included Prototype javascript library has been upgraded to version 1.6.0.3.
* +RJS#page.reload+ to reload the browser's current location via javascript
* The +atom_feed+ helper now takes an +:instruct+ option to let you insert XML processing instructions.
@@ -323,23 +325,23 @@ If you delegate behavior from one class to another, you can now specify a prefix
[source, ruby]
-------------------------------------------------------
-class Vendor << ActiveRecord::Base
+class Vendor < ActiveRecord::Base
has_one :account
delegate :email, :password, :to => :account, :prefix => true
end
-------------------------------------------------------
-This will produce delegated methods +vendor.account_email+ and +vendor.account_password+. You can also specify a custom prefix:
+This will produce delegated methods +vendor#account_email+ and +vendor#account_password+. You can also specify a custom prefix:
[source, ruby]
-------------------------------------------------------
-class Vendor << ActiveRecord::Base
+class Vendor < ActiveRecord::Base
has_one :account
delegate :email, :password, :to => :account, :prefix => :owner
end
-------------------------------------------------------
-This will produce delegated methods +vendor.owner_email+ and +vendor.owner_password+.
+This will produce delegated methods +vendor#owner_email+ and +vendor#owner_password+.
Lead Contributor: link:http://workingwithrails.com/person/5830-daniel-schierbeck[Daniel Schierbeck]
@@ -353,6 +355,7 @@ Lead Contributor: link:http://workingwithrails.com/person/5830-daniel-schierbeck
* +Inflector#parameterize+ produces a URL-ready version of its input, for use in +to_param+.
* +Time#advance+ recognizes fractional days and weeks, so you can do +1.7.weeks.ago+, +1.5.hours.since+, and so on.
* The included TzInfo library has been upgraded to version 0.3.11.
+* +ActiveSuport::StringInquirer+ gives you a pretty way to test for equality in strings: +ActiveSupport::StringInquirer.new("abc").abc? => true+
== Railties
@@ -370,11 +373,12 @@ To avoid deployment issues and make Rails applications more self-contained, it's
* +rake gems:build+ to build any missing native extensions
* +rake gems:refresh_specs+ to bring vendored gems created with Rails 2.1 into alignment with the Rails 2.2 way of storing them
-You can unpack or install a single gem by specifying +GEM=_gem_name+ on the command line.
+You can unpack or install a single gem by specifying +GEM=_gem_name_+ on the command line.
* Lead Contributor: link:http://github.com/al2o3cr[Matt Jones]
* More information:
- link:http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies[What's New in Edge Rails: Gem Dependencies]
+ - link:http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/[Rails 2.1.2 and 2.2RC1: Update Your RubyGems]
=== Other Railties Changes
@@ -383,7 +387,7 @@ You can unpack or install a single gem by specifying +GEM=_gem_name+ on the comm
* +script/console+ now supports a +--debugger+ option
* Instructions for setting up a continuous integration server to build Rails itself are included in the Rails source
* +rake notes:custom ANNOTATION=MYFLAG+ lets you list out custom annotations.
-* Wrapped +Rails.env+ in +StringQuestioneer+ so you can do +Rails.env.development?+
+* Wrapped +Rails.env+ in +StringInquirer+ so you can do +Rails.env.development?+
* +script/generate+ works without deprecation warnings when RubyGems 1.3.0 is present
== Deprecated
View
2  railties/doc/guides/source/actioncontroller_basics/filters.txt
@@ -55,8 +55,6 @@ Now, the LoginsController's "new" and "create" actions will work as before witho
In addition to the before filters, you can run filters after an action has run or both before and after. The after filter is similar to the before filter, but because the action has already been run it has access to the response data that's about to be sent to the client. Obviously, after filters can not stop the action from running. Around filters are responsible for running the action, but they can choose not to, which is the around filter's way of stopping it.
-TODO: Find a real example for an around filter
-
[source, ruby]
---------------------------------
# Example taken from the Rails API filter documentation:
View
4 railties/doc/guides/source/active_record_basics.txt
@@ -1,7 +1,7 @@
Active Record Basics
====================
-Active Record is a design pattern that mitigates the mind-numbing mental gymnastics often needed to get your application to communicate with a database. This guide explains in detail how This guide uses a mix of real-world examples, metaphors and detailed explanations of the actual Rails source code to help you make the most of AcitveRecord.
+Active Record is a design pattern that mitigates the mind-numbing mental gymnastics often needed to get your application to communicate with a database. This guide uses a mix of real-world examples, metaphors and detailed explanations of the actual Rails source code to help you make the most of AcitveRecord.
After reading this guide readers should have a strong grasp of the Active Record pattern and how it can be used with or without Rails. Hopefully, some of the philosophical and theoretical intentions discussed here will also make them a stronger and better developer.
@@ -178,4 +178,4 @@ Rails has a reputation of being a zero-config framework which means that it aim
* (6) before_create
* (-) create
* (7) after_create
- * (8) after_save
+ * (8) after_save
View
4 railties/doc/guides/source/association_basics.txt
@@ -359,7 +359,7 @@ class Employee < ActiveRecord::Base
end
-------------------------------------------------------
-With this setup, you can retrieve +@employee.subordinates+ and +@employee.managers+.
+With this setup, you can retrieve +@employee.subordinates+ and +@employee.manager+.
== Tips, Tricks, and Warnings
@@ -765,6 +765,8 @@ If you set the +:readonly+ option to +true+, then the associated object will be
The +:select+ option lets you override the SQL +SELECT+ clause that is used to retrieve data about the associated object. By default, Rails retrieves all columns.
+TIP: If you set the +:select+ option on a +belongs_to+ association, you should also set the +foreign_key+ option to guarantee the correct results.
+
===== +:validate+
If you set the +:validate+ option to +true+, then associated objects will be validated whenever you save this object. By default, this is +false+: associated objects will not be validated when this object is saved.
View
45,904 railties/doc/guides/source/benchmarking_and_profiling/examples/graph.html
0 additions, 45,904 deletions not shown
View
412 railties/doc/guides/source/benchmarking_and_profiling/images/kgraph.png.html
@@ -1,412 +0,0 @@
-
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>railties/doc/guides/benchmarking_and_profiling/images/kgraph.png at master from lifo's docrails &mdash; GitHub</title>
- <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
- <link rel="fluid-icon" href="http://github.com/fluidicon.png" title="GitHub" />
-
-
- <link href="/stylesheets/bundle.css?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" media="screen" rel="stylesheet" type="text/css" />
-
-
-
-
- <script src="/javascripts/bundle.js?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" type="text/javascript"></script>
-
-
-
-
-
-
-
- <link href="http://github.com/feeds/lifo/commits/docrails/master" rel="alternate" title="Recent Commits to docrails:master" type="application/atom+xml" />
-
-
-
- </head>
-
-
-
- <body>
-
-
- <div id="main">
- <div id="header" class="">
- <div class="site">
- <div class="logo">
- <a href="/"><img src="/images/modules/header/logo.png" alt="git-hub" /></a>
- </div>
-
- <div class="corner userbox">
- <div class="box">
- <div class="gravatar">
- <a href="/"><img alt="" height="40" src="http://www.gravatar.com/avatar/53ba5e473bbc79491e5df45c7aea8133?s=40&amp;d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-40.png" width="40" /></a>
- </div>
-
- <div class="top">
- <div class="name">
- <a href="/">FotoVerite</a>
- </div>
- <div class="links">
- <a href="/account">account</a> |
- <a href="/FotoVerite">profile</a> |
- <a href="/guides">guides</a> |
- <a href="/logout">log out</a>
- </div>
- </div>
-
- <div class="bottom">
- <div class="select">
- <div class="site_links">
- repositories:
- <a href="/repositories">all</a> |
- <a href="/search" class="search_repos_link">search</a>
- </div>
-
- <form action="/search" class="search_repos" method="get" style="display:none;">
- <input id="q" name="q" size="18" type="search" />
- <input type="submit" value="Search" />
- <a href="#" class="cancel_search_link">x</a>
- </form>
- </div>
-
- <div class="inbox"> <strong><a href="/inbox">3</a></strong> </div>
- </div>
- </div>
-</div>
-
-
- </div>
- </div>
-
-
-
- <div id="repo_menu">
- <div class="site">
- <ul>
-
- <li class="active"><a href="/lifo/docrails/tree/master">Source</a></li>
-
- <li class=""><a href="/lifo/docrails/commits/master">Commits</a></li>
-
- <li class=""><a href="/lifo/docrails/graphs">Graphs</a></li>
-
- <li class=""><a href="/lifo/docrails/wikis">Wiki (3)</a></li>
-
- <li class=""><a href="/lifo/docrails/watchers">Watchers (184)</a></li>
-
- <li class=""><a href="/lifo/docrails/network">Network (18)</a></li>
-
-
-
-
- </ul>
- </div>
- </div>
-
- <div id="repo_sub_menu">
- <div class="site">
- <div class="joiner"></div>
-
-
-
-
-
- <ul>
- <li>
- <a class="active" href="/lifo/docrails/tree/090603ea59888ce6d85a835c9f93a7d9cd609aa1">master</a>
- </li>
- <li>
- <a href="#">all branches</a>
- <ul>
-
- <li><a href="/lifo/docrails/tree/master">master</a></li>
-
- </ul>
- </li>
- <li>
- <a href="#">all tags</a>
-
- </li>
- </ul>
-
-
- </div>
- </div>
-
- <div class="site">
-
-
-
-
-<div id="repos">
-
-
-
-<div class="repo public">
- <div class="title">
- <div class="path">
- <a href="/lifo">lifo</a> / <b><a href="/lifo/docrails/tree">docrails</a></b>
-
-
-
-
-
-
-
- <a href="/lifo/docrails/pull_request/master" class="pull_request_button"><img alt="pull request" class="button" src="/images/modules/repos/pull_request_button.png?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" /></a>
-
-
-
-
- <a href="/lifo/docrails/fork"><img alt="fork" class="button" src="/images/modules/repos/fork_button.png?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" /></a>
-
-
-
- <a href="/lifo/docrails/toggle_watch" class="toggle_watch" style="display:none;"><img alt="watch" class="button" src="/images/modules/repos/watch_button.png?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" /></a><a href="/lifo/docrails/toggle_watch" class="toggle_watch"><img alt="watch" class="button" src="/images/modules/repos/unwatch_button.png?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" /></a>
-
-
- <a href="#" id="download_button" rel="/lifo/docrails/downloads/master"><img alt="download tarball" class="button" src="/images/modules/repos/download_button.png?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" /></a>
-
-
- </div>
-
- <div class="security private_security" style="display:none">
- <a href="#private_repo" rel="facebox"><img src="/images/icons/private.png" alt="private" /></a>
- </div>
-
- <div id="private_repo" class="hidden">
- This repository is private.
- All pages are served over SSL and all pushing and pulling is done over SSH.
- No one may fork, clone, or view it unless they are added as a <a href="/lifo/docrails/edit/collaborators">member</a>.
-
- <br/>
- <br/>
- Every repository with this icon (<img src="/images/icons/private.png" alt="private" />) is private.
- </div>
-
- <div class="security public_security" style="">
- <a href="#public_repo" rel="facebox"><img src="/images/icons/public.png" alt="public" /></a>
- </div>
-
- <div id="public_repo" class="hidden">
- This repository is public.
- Anyone may fork, clone, or view it.
-
- <br/>
- <br/>
- Every repository with this icon (<img src="/images/icons/public.png" alt="public" />) is public.
- </div>
-
-
- </div>
- <div class="meta">
- <table>
-
-
- <tr>
- <td class="label">Description:</td>
- <td>
- <span id="repository_description" rel="/lifo/docrails/edit/update" class="">PLEASE CHECK http://github.com/lifo/docrails/wikis</span>
-
- </td>
- </tr>
-
-
-
-
- <tr>
- <td class="label">Homepage:</td>
- <td>
-
- <a href="http://weblog.rubyonrails.org/2008/5/2/help-improve-rails-documentation-on-git-branch">http://weblog.rubyonrails.org/2008/5/2/help-improve-rails-documentation-on-git-branch</a>
-
- </td>
- </tr>
-
-
- <tr>
- <td class="label">Public&nbsp;Clone&nbsp;URL:</td>
-
- <td>
- <a href="git://github.com/lifo/docrails.git" class="git_url_facebox" rel="#git-clone">git://github.com/lifo/docrails.git</a>
- <div id="git-clone" style="display:none;">
- Give this clone URL to anyone.
- <br/>
- <code>git clone git://github.com/lifo/docrails.git </code>
- </div>
- </td>
- </tr>
-
-
- <tr>
- <td class="label">Your Clone URL:</td>
-
- <td>
-
- <div id="private-clone-url">
- <a href="git@github.com:lifo/docrails.git" class="git_url_facebox" rel="#your-git-clone">git@github.com:lifo/docrails.git</a>
- <input type="text" value="git@github.com:lifo/docrails.git" style="display: none;" />
- </div>
-
- <div id="your-git-clone" style="display:none;">
- Use this clone URL yourself.
- <br/>
- <code>git clone git@github.com:lifo/docrails.git </code>
- </div>
- </td>
- </tr>
-
-
- <tr>
- <td class="label">Search Repo:</td>
- <td>
- <form action="/lifo/docrails/search" method="get">
- <input type="text" name="q" value="" /> <select name="choice"><option value="code">Code</option><option value="grep">Commit Messages</option><option value="author">Author</option><option value="committer">Committer</option></select>
- <input type="submit" value="Go" />
- </form>
- </td>
- </tr>
-
- </table>
-
- </div>
-</div>
-
-</div>
-
-<div id="commit">
- <div class="group">
- <div class="envelope commit">
- <div class="human">
-
- <div class="message"><pre><a href="/lifo/docrails/commit/090603ea59888ce6d85a835c9f93a7d9cd609aa1">rmoved ds_store</a> </pre></div>
-
-
- <div class="actor">
- <div class="gravatar">
-
- <img alt="" height="30" src="http://www.gravatar.com/avatar/1f448a4c14d8191e7078d4cb4167cf6a?s=30&amp;d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-30.png" width="30" />
- </div>
- <div class="name">Matthew Bergman <span>(author)</span></div>
- <div class="date">
- <abbr class="relatize" title="2008-09-21 20:01:41">Sun Sep 21 20:01:41 -0700 2008</abbr>
- </div>
- </div>
-
-
-
- </div>
- <div class="machine">
- <span>c</span>ommit&nbsp;&nbsp;<a href="/lifo/docrails/commit/090603ea59888ce6d85a835c9f93a7d9cd609aa1" hotkey="c">090603ea59888ce6d85a835c9f93a7d9cd609aa1</a><br />
- <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="/lifo/docrails/tree/090603ea59888ce6d85a835c9f93a7d9cd609aa1/railties/doc/guides/benchmarking_and_profiling/images/kgraph.png" hotkey="t">e0ff3a49042b8ce48786769bd4906900816ffa69</a><br />
-
-
- <span>p</span>arent&nbsp;
-
- <a href="/lifo/docrails/tree/ae0e85d9ea971f2fd67571771feb78b28ee8c5b5/railties/doc/guides/benchmarking_and_profiling/images/kgraph.png" hotkey="p">ae0e85d9ea971f2fd67571771feb78b28ee8c5b5</a>
-
-
- </div>
-</div>
-
- </div>
-</div>
-
-
-
-
- <div id="path">
- <b><a href="/lifo/docrails/tree">docrails</a></b> / <a href="/lifo/docrails/tree/master/railties">railties</a> / <a href="/lifo/docrails/tree/master/railties/doc">doc</a> / <a href="/lifo/docrails/tree/master/railties/doc/guides">guides</a> / <a href="/lifo/docrails/tree/master/railties/doc/guides/benchmarking_and_profiling">benchmarking_and_profiling</a> / <a href="/lifo/docrails/tree/master/railties/doc/guides/benchmarking_and_profiling/images">images</a> / kgraph.png
- </div>
-
-
- <div id="files">
- <div class="file">
- <div class="meta">
- <div class="info">
- <span>100644</span>
- <span></span>
- <span>92.342 kb</span>
- </div>
- <div class="actions">
-
- <a href="/lifo/docrails/tree/master%2Frailties%2Fdoc%2Fguides%2Fbenchmarking_and_profiling%2Fimages%2Fkgraph.png?raw=true" id="raw-url">raw</a>
- <a href="/lifo/docrails/commits/master/railties/doc/guides/benchmarking_and_profiling/images/kgraph.png">history</a>
- </div>
- </div>
-
- <div class="data syntax">
-
- <div class="image">
-
- <img src="/lifo/docrails/tree/master%2Frailties%2Fdoc%2Fguides%2Fbenchmarking_and_profiling%2Fimages%2Fkgraph.png?raw=true" />
-
- </div>
-
- </div>
-
- </div>
-</div>
-
-<div id="readme" class="blob">
-
-</div>
-
-
-
-
-
- </div>
-
-
-
- <div class="push"></div>
- </div>
-
- <div id="footer">
- <div class="site">
- <div class="info">
- <div class="links">
- <a href="http://github.com/blog"><strong>Blog</strong></a> |
- <a href="http://groups.google.com/group/github/">Google Group</a> |
- <a href="http://logicalawesome.lighthouseapp.com/projects/8570/home">Report a Bug</a> |
- <a href="http://logicalawesome.lighthouseapp.com/projects/8570/home">Request a Feature</a> |
- <a href="mailto:support@github.com">Contact</a> |
- <a href="http://github.wordpress.com">Status</a>
- </div>
- <div class="company">
- <span id="_rrt" title="0.13158s from github.com">GitHub</span>
- is <a href="http://logicalawesome.com/">Logical Awesome</a> | &copy;2008 | <a href="/site/terms">Terms of Service</a> | <a href="/site/privacy">Privacy Policy</a>
- </div>
- </div>
- <div class="sponsor">
- <a href="http://engineyard.com">Hosting provided by</a>&nbsp;
- <a href="http://engineyard.com">
- <img src="/images/modules/footer/engine_yard_logo.gif" alt="Hosted by Engine Yard" />
- </a>
- </div>
- </div>
- </div>
-
- <div id="coming_soon" style="display:none;">
- This feature is coming soon. Sit tight!
- </div>
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-3769691-2");
- pageTracker._initData();
- pageTracker._trackPageview();
- </script>
-
- </body>
-</html>
-
View
412 railties/doc/guides/source/benchmarking_and_profiling/images/klist.png.html
@@ -1,412 +0,0 @@
-
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>railties/doc/guides/benchmarking_and_profiling/images/klist.png at master from lifo's docrails &mdash; GitHub</title>
- <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
- <link rel="fluid-icon" href="http://github.com/fluidicon.png" title="GitHub" />
-
-
- <link href="/stylesheets/bundle.css?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" media="screen" rel="stylesheet" type="text/css" />
-
-
-
-
- <script src="/javascripts/bundle.js?a8f4ebd32ecab61db2c48cac550b9c38e4535ed4" type="text/javascript"></script>
-
-
-
-
-
-
-
- <link href="http://github.com/feeds/lifo/commits/docrails/master" rel="alternate" title="Recent Commits to docrails:master" type="application/atom+xml" />
-
-
-
- </head>
-
-
-
- <body>
-
-
- <div id="main">
- <div id="header" class="">
- <div class="site">
- <div class="logo">
- <a href="/"><img src="/images/modules/header/logo.png" alt="git-hub" /></a>
- </div>
-
- <div class="corner userbox">
- <div class="box">
- <div class="gravatar">
- <a href="/"><img alt="" height="40" src="http://www.gravatar.com/avatar/53ba5e473bbc79491e5df45c7aea8133?s=40&amp;d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-40.png" width="40" /></a>
- </div>
-
- <div class="top">
- <div class="name">
- <a href="/">FotoVerite</a>
- </div>
- <div class="links">
- <a href="/account">account</a> |
- <a href="/FotoVerite">profile</a> |
- <a href="/guides">guides</a> |
- <a href="/logout">log out</a>
- </div>
- </div>
-
- <div class="bottom">
- <div class="select">
- <div class="site_links">
- repositories:
- <a href="/repositories">all</a> |
- <a href="/search" class="search_repos_link">search</a>
- </div>
-
- <form action="/search" class="search_repos" method="get" style="display:none;">
- <input id="q" name="q" size="18" type="search" />
- <input type="submit" value="Search" />
- <a href="#" class="cancel_search_link">x</a>
- </form>
- </div>
-
- <div class="inbox"> <strong><a href="/inbox">3</a></strong> </div>
- </div>
- </div>
-</div>
-
-
- </div>
- </div>
-
-
-
- <div id="repo_menu">
- <div class="site">
- <ul>
-
- <li class="active"><a href="/lifo/docrails/tree/master">Source</a></li>
-
- <li class=""><a href="/lifo/docrails/commits/master">Commits</a></li>
-
- <li class=""><a href="/lifo/docrails/graphs">Graphs</a></li>
-
- <li class=""><a href="/lifo/docrails/wikis">Wiki (3)</a></li>
-
- <li class=""><a href="/lifo/docrails/watchers">Watchers (184)</a></li>
-
- <li <