From 50b175030ab68f65bd54c6023c5d6c5e5e66bd2c Mon Sep 17 00:00:00 2001 From: Jamison Dance Date: Tue, 14 Sep 2010 17:14:16 -0600 Subject: [PATCH 01/18] fixed an unclear description in Sigular Resources. --- railties/guides/source/routing.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 7e1b0c2e32..6c593a8da5 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -116,7 +116,7 @@ resources :videos h4. Singular Resources -Sometimes, you have a resource that clients always look up without referencing an ID. A common example, +/profile+ always shows the profile of the currently logged in user. In this case, you can use a singular resource to map +/profile+ (rather than +/profile/:id+) to the +show+ action. +Sometimes, you have a resource that clients always look up without referencing an ID. For example, you would like +/profile+ to always show the profile of the currently logged in user. In this case, you can use a singular resource to map +/profile+ (rather than +/profile/:id+) to the +show+ action. match "profile" => "users#show" From cedc49dbd3669c82a8844c13a7aa3e165062c9e7 Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Wed, 15 Sep 2010 14:22:43 +1000 Subject: [PATCH 02/18] Updated the Cache Money repo link to one that works with Rails 3. --- railties/guides/source/caching_with_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/caching_with_rails.textile b/railties/guides/source/caching_with_rails.textile index 818c6eb00e..09cd796271 100644 --- a/railties/guides/source/caching_with_rails.textile +++ b/railties/guides/source/caching_with_rails.textile @@ -367,7 +367,7 @@ h3. Advanced Caching Along with the built-in mechanisms outlined above, a number of excellent plugins exist to help with finer grained control over caching. These include Chris Wanstrath's excellent cache_fu plugin (more info "here":http://errtheblog.com/posts/57-kickin-ass-w-cachefu ) and Evan Weaver's interlock plugin (more info "here":http://blog.evanweaver.com/articles/2007/12/13/better-rails-caching/ ). Both of these plugins play nice with memcached and are a must-see for anyone seriously considering optimizing their caching needs. -Also the new "Cache money":http://github.com/nkallen/cache-money/tree/master plugin is supposed to be mad cool. +Also the new "Cache money":http://github.com/ngmoco/cache-money/tree/rails3 plugin is supposed to be mad cool. h3. References From bda6de2722a859049fa72c9a5d39880bdb74252f Mon Sep 17 00:00:00 2001 From: oamblet Date: Wed, 15 Sep 2010 10:11:07 +0200 Subject: [PATCH 03/18] Updated old fashion form_for samples. when 'form_for :resource, @resource ...' is found, remove the first argument (there is no need to use the :as option when the name is the same). --- railties/guides/source/action_view_overview.textile | 2 +- railties/guides/source/form_helpers.textile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index 459d70f111..843dfe530d 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -654,7 +654,7 @@ The core method of this helper, form_for, gives you the ability to create a form # Note: a @person variable will have been created in the controller (e.g. @person = Person.new) -<%= form_for :person, @person, :url => { :action => "create" } do |f| %> +<%= form_for @person, :url => { :action => "create" } do |f| %> <%= f.text_field :first_name %> <%= f.text_field :last_name %> <%= submit_tag 'Create' %> diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile index 146b75da3f..26cbdfc44f 100644 --- a/railties/guides/source/form_helpers.textile +++ b/railties/guides/source/form_helpers.textile @@ -222,7 +222,7 @@ end The corresponding view +app/views/articles/new.html.erb+ using +form_for+ looks like this: -<%= form_for :article, @article, :url => { :action => "create" }, :html => {:class => "nifty_form"} do |f| %> +<%= form_for @article, :url => { :action => "create" }, :html => {:class => "nifty_form"} do |f| %> <%= f.text_field :title %> <%= f.text_area :body, :size => "60x12" %> <%= submit_tag "Create" %> @@ -253,7 +253,7 @@ The helper methods called on the form builder are identical to the model object You can create a similar binding without actually creating +<form>+ tags with the +fields_for+ helper. This is useful for editing additional model objects with the same form. For example if you had a Person model with an associated ContactDetail model you could create a form for creating both like so: -<%= form_for :person, @person, :url => { :action => "create" } do |person_form| %> +<%= form_for @person, :url => { :action => "create" } do |person_form| %> <%= person_form.text_field :name %> <%= fields_for @person.contact_detail do |contact_details_form| %> <%= contact_details_form.text_field :phone_number %> From 6f3ac42550ed6780427e723de61f351537d582bf Mon Sep 17 00:00:00 2001 From: rspeicher Date: Wed, 15 Sep 2010 19:19:48 -0400 Subject: [PATCH 04/18] Typos --- actionpack/lib/action_view/helpers/form_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 79a9d997dd..700a5a0ef1 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -211,7 +211,7 @@ module ActionView # If you have an object that needs to be represented as a different # parameter, like a Client that acts as a Person: # - # <%= form_for(@post, :as => :client do |f| %> + # <%= form_for(@post, :as => :client) do |f| %> # ... # <% end %> # @@ -228,8 +228,8 @@ module ActionView # ... # <% end %> # - # Where +@document = Document.find(params[:id])+ and - # +@comment = Comment.new+. + # Where @document = Document.find(params[:id]) and + # @comment = Comment.new. # # === Unobtrusive JavaScript # From dfebdb1b033c033b7a39615a39d9d4ac3052e61d Mon Sep 17 00:00:00 2001 From: Alexey Mahotkin Date: Thu, 16 Sep 2010 17:10:36 +0400 Subject: [PATCH 05/18] Tiny fixes to rdoc --- actionpack/lib/action_view/base.rb | 2 +- actionpack/lib/action_view/helpers/javascript_helper.rb | 2 +- actionpack/lib/action_view/helpers/prototype_helper.rb | 8 ++++---- activemodel/lib/active_model/validator.rb | 4 ++-- activeresource/test/cases/base/schema_test.rb | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index b0a57f47d3..3fa46d0f43 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -153,7 +153,7 @@ module ActionView #:nodoc: # # This refreshes the sidebar, removes a person element and highlights the user list. # - # See the ActionView::Helpers::PrototypeHelper::GeneratorMethods documentation for more details. + # See the ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods documentation for more details. class Base module Subclasses end diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index f392d92e75..cd3a3eac80 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -65,7 +65,7 @@ module ActionView # //]]> # # - # +html_options+ may be a hash of attributes for the diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index bc67197e64..300207dfac 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -161,7 +161,7 @@ module ActionView # JavaScriptGenerator generates blocks of JavaScript code that allow you # to change the content and presentation of multiple DOM elements. Use - # this in your Ajax response bodies, either in a