From 5f808b865cc0bbb10af7733cc0c4da3add572a95 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 8 Apr 2010 12:17:46 -0700 Subject: Consistently use lowercase instead of camelCase for all JS class names in Rails --- .../lib/action_view/helpers/form_tag_helper.rb | 20 ++++++++++---------- actionpack/lib/action_view/helpers/url_helper.rb | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 67b4e842b1..388d6813ef 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -199,8 +199,8 @@ module ActionView # file_field_tag 'attachment' # # => # - # file_field_tag 'avatar', :class => 'profile-input' - # # => + # file_field_tag 'avatar', :class => 'profile_input' + # # => # # file_field_tag 'picture', :disabled => true # # => @@ -244,8 +244,8 @@ module ActionView # password_field_tag 'confirm_pass', nil, :disabled => true # # => # - # password_field_tag 'pin', '1234', :maxlength => 4, :size => 6, :class => "pin-input" - # # => + # password_field_tag 'pin', '1234', :maxlength => 4, :size => 6, :class => "pin_input" + # # => def password_field_tag(name = "password", value = nil, options = {}) text_field_tag(name, value, options.update("type" => "password")) end @@ -374,8 +374,8 @@ module ActionView # submit_tag nil, :class => "form_submit" # # => # - # submit_tag "Edit", :disable_with => "Editing...", :class => "edit-button" - # # => "Editing...", :class => "edit_button" + # # => # # submit_tag "Save", :confirm => "Are you sure?" @@ -414,11 +414,11 @@ module ActionView # image_submit_tag("purchase.png", :disabled => true) # # => # - # image_submit_tag("search.png", :class => 'search-button') - # # => + # image_submit_tag("search.png", :class => 'search_button') + # # => # - # image_submit_tag("agree.png", :disabled => true, :class => "agree-disagree-button") - # # => + # image_submit_tag("agree.png", :disabled => true, :class => "agree_disagree_button") + # # => def image_submit_tag(source, options = {}) options.stringify_keys! diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 5925faf810..0b748d700b 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -265,7 +265,7 @@ module ActionView # using the +link_to+ method with the :method modifier as described in # the +link_to+ documentation. # - # The generated form element has a class name of button-to + # The generated form element has a class name of button_to # to allow styling of the form itself and its children. You can control # the form submission and input element behavior using +html_options+. # This method accepts the :method and :confirm modifiers @@ -289,14 +289,14 @@ module ActionView # # ==== Examples # <%= button_to "New", :action => "new" %> - # # => "
+ # # => " # #
# #
" # # # <%= button_to "Delete Image", { :action => "delete", :id => @image.id }, # :confirm => "Are you sure?", :method => :delete %> - # # => "
+ # # => " # #
# # # # @@ -306,7 +306,7 @@ module ActionView # # <%= button_to('Destroy', 'http://www.example.com', :confirm => 'Are you sure?', # :method => "delete", :remote => true, :disable_with => 'loading...') %> - # # => " + # # => " # #
# # # # @@ -338,7 +338,7 @@ module ActionView html_options.merge!("type" => "submit", "value" => name) - ("
" + + ("
" + method_tag + tag("input", html_options) + request_token_tag + "
").html_safe end -- cgit v1.2.3