From 9be59e49bfce68f8ac5a73c4322fe16a475d282e Mon Sep 17 00:00:00 2001 From: James Miller Date: Wed, 25 Aug 2010 14:36:10 -0700 Subject: Fix typo, favour => favor --- railties/guides/source/3_0_release_notes.textile | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/3_0_release_notes.textile b/railties/guides/source/3_0_release_notes.textile index 14da650e83..464fd66b7b 100644 --- a/railties/guides/source/3_0_release_notes.textile +++ b/railties/guides/source/3_0_release_notes.textile @@ -201,9 +201,9 @@ Finally a couple of enhancements were added to the rake tasks: Railties now deprecates: -* RAILS_ROOT in favour of Rails.root, -* RAILS_ENV in favour of Rails.env, and -* RAILS_DEFAULT_LOGGER in favour of Rails.logger. +* RAILS_ROOT in favor of Rails.root, +* RAILS_ENV in favor of Rails.env, and +* RAILS_DEFAULT_LOGGER in favor of Rails.logger. PLUGIN/rails/tasks, and PLUGIN/tasks are no longer loaded all tasks now must be in PLUGIN/lib/tasks. @@ -241,7 +241,7 @@ h4. Action Controller Deprecations: -* filter_parameter_logging is deprecated in favour of config.filter_parameters << :password. +* filter_parameter_logging is deprecated in favor of config.filter_parameters << :password. More Information: * "Render Options in Rails 3":http://www.engineyard.com/blog/2010/render-options-in-rails-3/ @@ -363,8 +363,8 @@ Validations have been moved from Active Record into Active Model, providing an i * The +validates+ method has the following options: * :acceptance => Boolean. * :confirmation => Boolean. - * :exclusion => { :in => Ennumerable }. - * :inclusion => { :in => Ennumerable }. + * :exclusion => { :in => Enumerable }. + * :inclusion => { :in => Enumerable }. * :format => { :with => Regexp, :on => :create }. * :length => { :maximum => Fixnum }. * :numericality => Boolean. @@ -452,7 +452,7 @@ h4. Patches and Deprecations Additionally, many fixes in the Active Record branch: -* SQLite 2 support has been dropped in favour of SQLite 3. +* SQLite 2 support has been dropped in favor of SQLite 3. * MySQL support for column order. * PostgreSQL adapter has had its +TIME ZONE+ support fixed so it no longer inserts incorrect values. * Support multiple schemas in table names for PostgreSQL. @@ -464,11 +464,11 @@ As well as the following deprecations: * +named_scope+ in an Active Record class is deprecated and has been renamed to just +scope+. * In +scope+ methods, you should move to using the relation methods, instead of a :conditions => {} finder method, for example scope :since, lambda {|time| where("created_at > ?", time) }. -* save(false) is deprecated, in favour of save(:validate => false). +* save(false) is deprecated, in favor of save(:validate => false). * I18n error messages for ActiveRecord should be changed from :en.activerecord.errors.template to :en.errors.template. -* model.errors.on is deprecated in favour of model.errors[] +* model.errors.on is deprecated in favor of model.errors[] * validates_presence_of => validates... :presence => true -* ActiveRecord::Base.colorize_logging and config.active_record.colorize_logging are deprecated in favour of Rails::LogSubscriber.colorize_logging or config.colorize_logging +* ActiveRecord::Base.colorize_logging and config.active_record.colorize_logging are deprecated in favor of Rails::LogSubscriber.colorize_logging or config.colorize_logging NOTE: While an implementation of State Machine has been in Active Record edge for some months now, it has been removed from the Rails 3.0 release. @@ -491,7 +491,7 @@ Active Resource was also extracted out to Active Model allowing you to use Activ * Renamed SchemaDefinition to Schema and define_schema to schema. * Use the format of Active Resources rather than the content-type of remote errors to load errors. * Use instance_eval for schema block. -* Fix ActiveResource::ConnectionError#to_s when +@response+ does not respond to #code or #message, handles Ruby 1.9 compat. +* Fix ActiveResource::ConnectionError#to_s when +@response+ does not respond to #code or #message, handles Ruby 1.9 compatibility. * Add support for errors in JSON format. * Ensure load works with numeric arrays. * Recognizes a 410 response from remote resource as the resource has been deleted. @@ -500,7 +500,7 @@ Active Resource was also extracted out to Active Model allowing you to use Activ Deprecations: -* save(false) is deprecated, in favour of save(:validate => false). +* save(false) is deprecated, in favor of save(:validate => false). * Ruby 1.9.2: URI.parse and .decode are deprecated and are no longer used in the library. @@ -551,7 +551,7 @@ The following methods have been removed because they are now available in Ruby 1 * Object#instance_variable_defined? * Enumerable#none? -The security patch for REXML remains in Active Support because early patchlevels of Ruby 1.8.7 still need it. Active Support knows whether it has to apply it or not. +The security patch for REXML remains in Active Support because early patch-levels of Ruby 1.8.7 still need it. Active Support knows whether it has to apply it or not. The following methods have been removed because they are no longer used in the framework: @@ -579,7 +579,7 @@ Action Mailer has been given a new API with TMail being replaced out with the ne Deprecations: -* :charset, :content_type, :mime_version, :implicit_parts_order are all deprecated in favour of ActionMailer.default :key => value style declarations. +* :charset, :content_type, :mime_version, :implicit_parts_order are all deprecated in favor of ActionMailer.default :key => value style declarations. * Mailer dynamic create_method_name and deliver_method_name are deprecated, just call method_name which now returns a Mail::Message object. * ActionMailer.deliver(message) is deprecated, just call message.deliver. * template_root is deprecated, pass options to a render call inside a proc from the format.mime_type method inside the mail generation block -- cgit v1.2.3 From 6e3c339ebea8cd9b0e30fa8f48d052205a5ed56d Mon Sep 17 00:00:00 2001 From: James Miller Date: Wed, 25 Aug 2010 14:42:11 -0700 Subject: mysql2 is now the default, typos --- railties/guides/source/getting_started.textile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index c292daa915..4823876f19 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -235,7 +235,7 @@ If you choose to use MySQL instead of the shipped Sqlite3 database, your +config development: - adapter: mysql + adapter: mysql2 encoding: utf8 database: blog_development pool: 5 @@ -1017,7 +1017,7 @@ Once we have made the new comment, we send the user back to the original post us Now you can add posts and comments to your blog and have them show up in the right places. -h3. Refactorization +h3. Refactoring Now that we have Posts and Comments working, if we take a look at the +app/views/posts/show.html.erb+ template, it's getting long and awkward. We can use partials to clean this up. @@ -1141,7 +1141,7 @@ Then you make the +app/views/posts/show.html.erb+ look like the following: <%= link_to 'Back to Posts', posts_path %> | -The second render just defines the partial template we want to render, comments/form, Rails is smart enough to spot the forward slash in that string and realise that you want to render the _form.html.erb file in the app/views/comments directory. +The second render just defines the partial template we want to render, comments/form, Rails is smart enough to spot the forward slash in that string and realize that you want to render the _form.html.erb file in the app/views/comments directory. The +@post+ object is available to any partials rendered in the view because we defined it as an instance variable. @@ -1279,7 +1279,7 @@ Again, run the migration to create the database table: $ rake db:migrate -Next, edit the +post.rb+ file to create the other side of the association, and to tell Rails (via the +accepts_nested_attributes+ macro) that you intend to edit tags via posts: +Next, edit the +post.rb+ file to create the other side of the association, and to tell Rails (via the +accepts_nested_attributes_for+ macro) that you intend to edit tags via posts: class Post < ActiveRecord::Base -- cgit v1.2.3 From 7a6d8e4ad47d571541762a6c80cc3e1f6831bd40 Mon Sep 17 00:00:00 2001 From: James Miller Date: Wed, 25 Aug 2010 14:55:24 -0700 Subject: to_json => as_json --- railties/guides/source/action_view_overview.textile | 2 +- railties/guides/source/layouts_and_rendering.textile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index e242cdaf73..cd3c0a1b7b 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -1380,7 +1380,7 @@ page.insert_html :bottom, 'my_list', '
  • Last item
  • ' h5. literal -Returns an object whose to_json evaluates to the code provided. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method. +Returns an object whose as_json evaluates to the code provided. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method. h5. redirect_to diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index fe5b4c8773..1bef4d2145 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -285,7 +285,7 @@ JSON is a javascript data format used by many AJAX libraries. Rails has built-in render :json => @product
    -TIP: You don't need to call +to_json+ on the object that you want to render. If you use the +:json+ option, +render+ will automatically call +to_json+ for you. +TIP: You don't need to call +as_json+ on the object that you want to render. If you use the +:json+ option, +render+ will automatically call +as_json+ for you. h5. Rendering XML -- cgit v1.2.3 From ee7507b38e14c39dd21aef581cffbe5dc3bd273b Mon Sep 17 00:00:00 2001 From: Aleksander Pohl Date: Sat, 29 May 2010 21:36:13 +0200 Subject: - Fix non-ascii characters in headers Signed-off-by: Xavier Noria --- railties/guides/rails_guides/indexer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/rails_guides/indexer.rb b/railties/guides/rails_guides/indexer.rb index bd817786ed..fb46491817 100644 --- a/railties/guides/rails_guides/indexer.rb +++ b/railties/guides/rails_guides/indexer.rb @@ -1,5 +1,6 @@ require 'active_support/core_ext/object/blank' require 'active_support/ordered_hash' +require 'active_support/core_ext/string/inflections' module RailsGuides class Indexer @@ -58,7 +59,7 @@ module RailsGuides end def title_to_idx(title) - idx = title.strip.downcase.gsub(/\s+|_/, '-').delete('^a-z0-9-').sub(/^[^a-z]*/, '') + idx = title.strip.parameterize.sub(/^\d+/, '') if warnings && idx.blank? puts "BLANK ID: please put an explicit ID for section #{title}, as in h5(#my-id)" end -- cgit v1.2.3