[Rails] Re: Store XML format data into database
Hi,
Now I am not getting an error but XML values are stored like '--0 \n'.
Code is:
doc.xpath('//item').each do |tag|
@req = Hash.new
@req = tag.children[9]
detail.create(
:my_field => tag.children[9]
)
end
And in detail_model.rb
class Detail < ActiveRecord::Base
serialize :my_field
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home