This code in my view triggers an error:
<% remote_form_for(mymodel) do |f| %>
<%= f.error_messages %>
(mymodel is not an ActiveRecord object)
When I look at the error trace, I see this section which indicates that error_messages in the view translates into error_messages_for
in the active_record_helper
:
C:/Ruby18/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/
helpers/active_record_helper.rb:179:in `error_messages_for'
C:/Ruby18/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/
helpers/form_helper.rb:984:in `error_messages'
Why does the form_helper
think that it should call the active_record_helper
even though 'mymodel' is not an ActiveRecord object?