Skip to content

Commit

Permalink
Rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jan 17, 2012
1 parent 801dcb0 commit 514308a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -655,7 +655,7 @@ def fields_for(record_name, record_object = nil, options = {}, &block)
# 'Accept <a href="/terms">Terms</a>.'.html_safe # 'Accept <a href="/terms">Terms</a>.'.html_safe
# end # end
def label(object_name, method, content_or_options = nil, options = nil, &block) def label(object_name, method, content_or_options = nil, options = nil, &block)
ActionView::Helpers::Tags::LabelTag.new(object_name, method, self, content_or_options, options).render(&block) ActionView::Helpers::Tags::Label.new(object_name, method, self, content_or_options, options).render(&block)
end end


# Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object
Expand All @@ -677,7 +677,7 @@ def label(object_name, method, content_or_options = nil, options = nil, &block)
# # => <input type="text" id="snippet_code" name="snippet[code]" size="20" value="#{@snippet.code}" class="code_input" /> # # => <input type="text" id="snippet_code" name="snippet[code]" size="20" value="#{@snippet.code}" class="code_input" />
# #
def text_field(object_name, method, options = {}) def text_field(object_name, method, options = {})
ActionView::Helpers::Tags::TextFieldTag.new(object_name, method, self, options).render ActionView::Helpers::Tags::TextField.new(object_name, method, self, options).render
end end


# Returns an input tag of the "password" type tailored for accessing a specified attribute (identified by +method+) on an object # Returns an input tag of the "password" type tailored for accessing a specified attribute (identified by +method+) on an object
Expand Down
6 changes: 3 additions & 3 deletions actionpack/lib/action_view/helpers/tags.rb
@@ -1,9 +1,9 @@
module ActionView module ActionView
module Helpers module Helpers
module Tags module Tags
autoload :BaseTag, 'action_view/helpers/tags/base_tag' autoload :Base, 'action_view/helpers/tags/base'
autoload :LabelTag, 'action_view/helpers/tags/label_tag' autoload :Label, 'action_view/helpers/tags/label'
autoload :TextFieldTag, 'action_view/helpers/tags/text_field_tag' autoload :TextField, 'action_view/helpers/tags/text_field'
end end
end end
end end
@@ -1,7 +1,7 @@
module ActionView module ActionView
module Helpers module Helpers
module Tags module Tags
class BaseTag class Base #:nodoc:
include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper


DEFAULT_FIELD_OPTIONS = { "size" => 30 } DEFAULT_FIELD_OPTIONS = { "size" => 30 }
Expand Down
@@ -1,7 +1,7 @@
module ActionView module ActionView
module Helpers module Helpers
module Tags module Tags
class LabelTag < BaseTag class Label < Base #:nodoc:
def initialize(object_name, method_name, template_object, content_or_options = nil, options = nil) def initialize(object_name, method_name, template_object, content_or_options = nil, options = nil)
content_is_options = content_or_options.is_a?(Hash) content_is_options = content_or_options.is_a?(Hash)
if content_is_options if content_is_options
Expand Down
@@ -1,7 +1,7 @@
module ActionView module ActionView
module Helpers module Helpers
module Tags module Tags
class TextFieldTag < BaseTag class TextField < Base #:nodoc:
def render def render
options = @options.stringify_keys options = @options.stringify_keys
options["size"] = options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"] unless options.key?("size") options["size"] = options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"] unless options.key?("size")
Expand Down

0 comments on commit 514308a

Please sign in to comment.