aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2011-12-04 22:12:24 +0300
committerVasiliy Ermolovich <younash@gmail.com>2011-12-04 22:12:24 +0300
commite29773f885fd500189ffd964550ae20061d745ba (patch)
treef2e0fe6f86ed4c833e5396611553b8a879243326 /actionpack/lib/action_view/helpers/form_helper.rb
parente9b6659c4ccd4272a363835274ec2e36e778dcd8 (diff)
downloadrails-e29773f885fd500189ffd964550ae20061d745ba.tar.gz
rails-e29773f885fd500189ffd964550ae20061d745ba.tar.bz2
rails-e29773f885fd500189ffd964550ae20061d745ba.zip
form_for with +:as+ option uses "action_as" as css class and id
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index e674e12509..1a64b12aa6 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -387,8 +387,8 @@ module ActionView
as = options[:as]
action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :put] : [:new, :post]
options[:html].reverse_merge!(
- :class => as ? "#{as}_#{action}" : dom_class(object, action),
- :id => as ? "#{as}_#{action}" : [options[:namespace], dom_id(object, action)].compact.join("_").presence,
+ :class => as ? "#{action}_#{as}" : dom_class(object, action),
+ :id => as ? "#{action}_#{as}" : [options[:namespace], dom_id(object, action)].compact.join("_").presence,
:method => method
)