>
> Hi there,
>
> I am fairly new to the Rails framework, so forgive me if there is an
> obvious solution to this problem.
>
> I am using Rails 2.1.0 and trying to jsonify a hash containing an
> array. E.g.
>
> result = { :name => "McLovin", :attachments => ['file.pdf',
> 'file.jpg'] }
> => {:attachments=>["file.pdf", "file.jpg"], :name=>"McLovin"}
> result.to_json
>
> I would expect something like:
>
> {
> "name": "McLovin",
> "attachments": [
> "file.pdf",
> "file.jpg"
> ]
> }
Which is exactly what I got when I tried this out. Do you have any
plugins/use any gems that could be clashing with activesupport's JSON
stuff?
Fred
> --~--~---------~--~----~------------~-------~--~----~
> 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 rubyonra...@googlegroups.com
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
I removed the "json_pure" gem and now it works for me too.. Not sure
if that will cause other problems, but we'll see about that.
Best regards, Mads Kristiansen