From d7a2431408429d0967d9b59f07c0d4637f744d71 Mon Sep 17 00:00:00 2001 From: Robert Massaioli Date: Mon, 13 Jun 2011 14:58:56 +1000 Subject: cycle: make an odd number be marked as odd. Just a minor issue that was annoying me so I thought that I would jump in and fix it. --- actionpack/lib/action_view/helpers/text_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 8f97eb7d75..472b996a5e 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -280,7 +280,7 @@ module ActionView # @items = [1,2,3,4] # # <% @items.each do |item| %> - # "> + # "> # # # <% end %> -- cgit v1.2.3 From 8da91036c0f6b4caf10e46db07f04d49398eea28 Mon Sep 17 00:00:00 2001 From: Christine Yen Date: Wed, 15 Jun 2011 01:55:57 -0700 Subject: Improve documentation around status code argument of redirect_to --- actionpack/lib/action_controller/metal/redirecting.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index 55c650df6c..99e200caa5 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -42,7 +42,8 @@ module ActionController # redirect_to :action=>'atom', :status => 302 # # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an - # integer, or a symbol representing the downcased, underscored and symbolized description. + # integer, or a symbol representing the downcased, underscored and symbolized description. Note that the status code + # must be a 3xx HTTP code, or redirection will not occur. # # It is also possible to assign a flash message as part of the redirection. There are two special accessors for commonly used the flash names # +alert+ and +notice+ as well as a general purpose +flash+ bucket. -- cgit v1.2.3 From c6381657b7c9dbf38d2afad61c61ad000c190927 Mon Sep 17 00:00:00 2001 From: Christine Yen Date: Wed, 15 Jun 2011 03:15:27 -0700 Subject: Clarify importance of *_attributes= writer methods for nested fields --- actionpack/lib/action_view/helpers/form_helper.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 7ed949504d..c1273e0f3d 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -517,6 +517,18 @@ module ActionView # end # end # + # Note that the projects_attributes= writer method is in fact + # required for fields_for to correctly identify :projects as a + # collection, and the correct indices to be set in the form markup. + # + # When projects is already an association on Person you can use + # +accepts_nested_attributes_for+ to define the writer method for you: + # + # class Person < ActiveRecord::Base + # has_many :projects + # accepts_nested_attributes_for :projects + # end + # # This model can now be used with a nested fields_for. The block given to # the nested fields_for call will be repeated for each instance in the # collection: @@ -568,14 +580,6 @@ module ActionView # ... # <% end %> # - # When projects is already an association on Person you can use - # +accepts_nested_attributes_for+ to define the writer method for you: - # - # class Person < ActiveRecord::Base - # has_many :projects - # accepts_nested_attributes_for :projects - # end - # # If you want to destroy any of the associated models through the # form, you have to enable it first using the :allow_destroy # option for +accepts_nested_attributes_for+: -- cgit v1.2.3 From 0a67b745be4eeb756160e6fa690e6551e0dde5ab Mon Sep 17 00:00:00 2001 From: Christine Yen Date: Wed, 15 Jun 2011 03:18:28 -0700 Subject: Tweak linebreak in ActionController::Redirecting doc --- actionpack/lib/action_controller/metal/redirecting.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index 99e200caa5..dee7eb1ec8 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -42,8 +42,8 @@ module ActionController # redirect_to :action=>'atom', :status => 302 # # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an - # integer, or a symbol representing the downcased, underscored and symbolized description. Note that the status code - # must be a 3xx HTTP code, or redirection will not occur. + # integer, or a symbol representing the downcased, underscored and symbolized description. + # Note that the status code must be a 3xx HTTP code, or redirection will not occur. # # It is also possible to assign a flash message as part of the redirection. There are two special accessors for commonly used the flash names # +alert+ and +notice+ as well as a general purpose +flash+ bucket. -- cgit v1.2.3 From 77c8cd75162e0771dd45930a4309d3183707731a Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 15 Jun 2011 18:56:22 +0530 Subject: form => form_for --- actionpack/lib/action_view/helpers/form_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index c1273e0f3d..649acffa77 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -290,7 +290,7 @@ module ActionView # # Example: # - # <%= form(@post) do |f| %> + # <%= form_for(@post) do |f| %> # <% f.fields_for(:comments, :include_id => false) do |cf| %> # ... # <% end %> -- cgit v1.2.3 From 6ca18f9037b8ce86d9fd3e19be754cc3f97de0fd Mon Sep 17 00:00:00 2001 From: "R.T. Lechow" Date: Thu, 16 Jun 2011 15:39:22 -0400 Subject: Typo. --- actionpack/lib/action_view/helpers/form_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 649acffa77..3debc9cc66 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -219,9 +219,9 @@ module ActionView # <% end %> # # If you have an object that needs to be represented as a different - # parameter, like a Client that acts as a Person: + # parameter, like a Person that acts as a Client: # - # <%= form_for(@post, :as => :client) do |f| %> + # <%= form_for(@person, :as => :client) do |f| %> # ... # <% end %> # -- cgit v1.2.3
item