If you want to make _html4 versions of many helpers then this might
help:

module ApplicationHelper

  class << self
    # Supports making alternative versions of Rails helpers that output
HTML
    # 4.01 markup as opposed to XHTML.  Example:
    #
    #   html4_version_of :submit_tag
    #
    # ..which creates a submit_tag_html4 helper that takes the same
options as
    # submit_tag but which renders HTML 4.01.
    #
    def html4_version_of  helper_name
      define_method "#{helper_name}_html4" do |*args|
        html = send  helper_name, *args
        html.gsub! " />", ">"
        html
      end
    end

    def html4_versions_of *helper_names
      helper_names.each do |helper_name|
        html4_version_of  helper_name
      end
    end
  end


  html4_versions_of :stylesheet_link_tag, :image_tag, :text_field,
:submit_tag

end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to