aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/active_model_helper.rb
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-02-02 13:30:08 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-02-02 13:30:08 +1100
commit535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81 (patch)
treedcbd2acf8e83493eea719bf0a0c51a9c121bf194 /actionpack/lib/action_view/helpers/active_model_helper.rb
parent49a26c533366eff63acd3c99ed0dffc04f85f55c (diff)
parent9b5dae7af5757769c1e69d74a59ff036adc1f30f (diff)
downloadrails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.tar.gz
rails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.tar.bz2
rails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_view/helpers/active_model_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/active_model_helper.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/active_model_helper.rb b/actionpack/lib/action_view/helpers/active_model_helper.rb
index 87b7adf6c4..e106bb0897 100644
--- a/actionpack/lib/action_view/helpers/active_model_helper.rb
+++ b/actionpack/lib/action_view/helpers/active_model_helper.rb
@@ -6,7 +6,7 @@ require 'active_support/core_ext/kernel/reporting'
module ActionView
class Base
- @@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"fieldWithErrors\">#{html_tag}</div>".html_safe! }
+ @@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"fieldWithErrors\">#{html_tag}</div>".html_safe }
cattr_accessor :field_error_proc
end
@@ -86,12 +86,11 @@ module ActionView
submit_value = options[:submit_value] || options[:action].gsub(/[^\w]/, '').capitalize
contents = form_tag({:action => action}, :method =>(options[:method] || 'post'), :enctype => options[:multipart] ? 'multipart/form-data': nil)
- contents << hidden_field(record_name, :id) unless record.new_record?
- contents << all_input_tags(record, record_name, options)
+ contents.safe_concat hidden_field(record_name, :id) unless record.new_record?
+ contents.safe_concat all_input_tags(record, record_name, options)
yield contents if block_given?
- contents << submit_tag(submit_value)
- contents << '</form>'
- contents.html_safe!
+ contents.safe_concat submit_tag(submit_value)
+ contents.safe_concat('</form>')
end
# Returns a string containing the error message attached to the +method+ on the +object+ if one exists.