Skip to content

Commit

Permalink
Added FormTagHelper#image_submit_tag for making submit buttons that u…
Browse files Browse the repository at this point in the history
…ses images

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed May 3, 2005
1 parent 2eebd11 commit d2fb072
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 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]
Expand Down
4 changes: 4 additions & 0 deletions actionpack/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -79,6 +79,10 @@ def submit_tag(value = "Save changes", options = {})
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
Expand Down

0 comments on commit d2fb072

Please sign in to comment.