1
我on Rails的3.1to_xml总是抛出错误
我已经粘贴下面的例子,但调用to_xml上任何模型抛出这个错误。我已经尝试了一切,但我是之前有人会看到的那种东西。它是否为任何人敲响了任何铃声?
1.8.7 :004 > Person.first.to_xml
Person Load (2.0ms) SELECT `people`.* FROM `people` LIMIT 1
ArgumentError: wrong number of arguments (1 for 0)
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:135:in `to_xs'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:135:in `_escape'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:140:in `_escape_quote'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:320:in `_attr_value'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:308:in `_insert_attributes'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:306:in `each'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:306:in `_insert_attributes'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:284:in `_special'
from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:250:in `instruct!'
from /home/khughes/.rvm/gems/[email protected]/gems/activemodel-3.1.1/lib/active_model/serializers/xml.rb:93:in `serialize'
from /home/khughes/.rvm/gems/[email protected]/gems/activerecord-3.1.1/lib/active_record/serializers/xml_serializer.rb:175:in `to_xml'
from (irb):4
这就是它!谢谢,我不认为我会记录下来。 – 2012-03-02 10:38:18