diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-03 14:30:53 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-03 14:30:53 +0000 |
commit | d2fb072563ff54109ecfec0119a192c8a9071889 (patch) | |
tree | 0ec4cda19cff772677564e91e99f5c26e47b1f6e | |
parent | 2eebd11e0bcdb81a605d61772e09853d4b45e21c (diff) | |
download | rails-d2fb072563ff54109ecfec0119a192c8a9071889.tar.gz rails-d2fb072563ff54109ecfec0119a192c8a9071889.tar.bz2 rails-d2fb072563ff54109ecfec0119a192c8a9071889.zip |
Added FormTagHelper#image_submit_tag for making submit buttons that uses images
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index fb017b7e7b..ddaa2e1a31 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added FormTagHelper#image_submit_tag for making submit buttons that uses images + * Added the option of specifying a RAILS_ASSET_HOST that will then be used by all the asset helpers. This enables you to easily offload static content like javascripts and images to a separate server tuned just for that. * Fixed action/fragment caching using the filestore when a directory and a file wanted to to use the same name. Now there's a .cache prefix that sidesteps the conflict #1188 [imbcmdth@hotmail.com] diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index d8535d2870..126a407cad 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -79,6 +79,10 @@ module ActionView tag("input", { "type" => "submit", "name" => "submit", "value" => value }.update(convert_options(options))) end + def image_submit_tag(source, options = {}) + tag("input", { "type" => "image", "src" => image_path(source) }.update(convert_options(options))) + end + private def convert_options(options) options = options.stringify_keys |