diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-02-01 23:42:38 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-02-01 23:42:38 +0000 |
commit | fdcf4d6c5191b25ee3b6c357dafaf17156eb09d3 (patch) | |
tree | 347f771202054a443f9df23a8f65f91d49a52209 /actionpack/lib/action_view/helpers/active_model_helper.rb | |
parent | 27fa38cc3e162b2f8c4bb2d50130fbc17bad6039 (diff) | |
parent | 16c0d1d3b6089bb4b0b0baf7c3eeb5949f31f02b (diff) | |
download | rails-fdcf4d6c5191b25ee3b6c357dafaf17156eb09d3.tar.gz rails-fdcf4d6c5191b25ee3b6c357dafaf17156eb09d3.tar.bz2 rails-fdcf4d6c5191b25ee3b6c357dafaf17156eb09d3.zip |
Merge remote branch 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_view/helpers/active_model_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/active_model_helper.rb | 11 |
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. |