aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-05 18:41:35 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-04-05 18:55:37 -0300
commitd270da569efeabd7cd563028816452236713aa9f (patch)
tree42a24776b809d939c06cef3b02d5851e99a7fb54 /actionpack/lib
parent1f7b4447a9030ccec542ecaa1e5e11e0d4622a84 (diff)
downloadrails-d270da569efeabd7cd563028816452236713aa9f.tar.gz
rails-d270da569efeabd7cd563028816452236713aa9f.tar.bz2
rails-d270da569efeabd7cd563028816452236713aa9f.zip
changed from :object_name to :as on form_for api
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index e44b43300d..45f41edcac 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -300,16 +300,16 @@ module ActionView
case record_or_name_or_array
when String, Symbol
- ActiveSupport::Deprecation.warn("Use the option :object_name => ... instead of a Symbol or String as a the first argument", caller)
+ ActiveSupport::Deprecation.warn("Using form_for(:name, @resource) is deprecated. Please use form_for(@resource, :as => :name) instead.", caller) unless args.empty?
object_name = record_or_name_or_array
when Array
object = record_or_name_or_array.last
- object_name = options[:object_name] || ActionController::RecordIdentifier.singular_class_name(object)
+ object_name = options[:as] || ActionController::RecordIdentifier.singular_class_name(object)
apply_form_for_options!(record_or_name_or_array, options)
args.unshift object
else
object = record_or_name_or_array
- object_name = options[:object_name] || ActionController::RecordIdentifier.singular_class_name(object)
+ object_name = options[:as] || ActionController::RecordIdentifier.singular_class_name(object)
apply_form_for_options!([object], options)
args.unshift object
end
@@ -327,12 +327,12 @@ module ActionView
html_options =
if object.respond_to?(:persisted?) && object.persisted?
- { :class => options[:object_name] ? "#{options[:object_name]}_edit" : dom_class(object, :edit),
- :id => options[:object_name] ? "#{options[:object_name]}_edit" : dom_id(object, :edit),
+ { :class => options[:as] ? "#{options[:as]}_edit" : dom_class(object, :edit),
+ :id => options[:as] ? "#{options[:as]}_edit" : dom_id(object, :edit),
:method => :put }
else
- { :class => options[:object_name] ? "#{options[:object_name]}_new" : dom_class(object, :new),
- :id => options[:object_name] ? "#{options[:object_name]}_new" : dom_id(object),
+ { :class => options[:as] ? "#{options[:as]}_new" : dom_class(object, :new),
+ :id => options[:as] ? "#{options[:as]}_new" : dom_id(object),
:method => :post }
end