diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-23 02:14:13 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-23 02:14:13 -0800 |
commit | ec65f144633aaf6791e97173448123790e69ff21 (patch) | |
tree | 65108613c06a978169ef0a222473ab9606203627 /actionpack/lib/action_view/helpers/tags/text_field.rb | |
parent | d4248fa02af38a8cdec5ddcad556b258e54a30bf (diff) | |
parent | 930245ef12fbbb0628c332d36bf09a33050d5b65 (diff) | |
download | rails-ec65f144633aaf6791e97173448123790e69ff21.tar.gz rails-ec65f144633aaf6791e97173448123790e69ff21.tar.bz2 rails-ec65f144633aaf6791e97173448123790e69ff21.zip |
Merge pull request #4612 from rafaelfranca/av-refactor
Some improvements on ActionView::Helpers::Tags
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags/text_field.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/text_field.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/text_field.rb b/actionpack/lib/action_view/helpers/tags/text_field.rb index 0f81726eb4..ce5182d20f 100644 --- a/actionpack/lib/action_view/helpers/tags/text_field.rb +++ b/actionpack/lib/action_view/helpers/tags/text_field.rb @@ -13,10 +13,16 @@ module ActionView tag("input", options) end + class << self + def field_type + @field_type ||= self.name.split("::").last.sub("Field", "").downcase + end + end + private def field_type - @field_type ||= self.class.name.split("::").last.sub("Field", "").downcase + self.class.field_type end end end |