def content_tag(name, content, options = {})
"<#{name + tag_options(options)}>#{content}#{name}>"
end
# Starts a form tag that points the action to an url configured with url_for_options just like
# ActionController::Base#url_for.
def form_tag(url_for_options = {}, options = {}, *parameters_for_url)
html_options = { "method" => "POST" }.merge(options)
if html_options[:multipart]
html_options["enctype"] = "multipart/form-data"
html_options.delete(:multipart)
end
html_options["action"] = url_for(url_for_options, *parameters_for_url)
tag("form", html_options, true)
end
alias_method :start_form_tag, :form_tag
# Outputs ""
def end_form_tag
""
end
private
def tag_options(options)
if options.empty?
""
else
" " + options.collect { |pair|
"#{pair.first}=\"#{html_escape(pair.last)}\""
}.sort.join(" ")
end
end
end
end
end