Ruby on Rails Thursday, February 7, 2019

On Thu, 7 Feb 2019 at 07:49, Colin Law <clanlaw@gmail.com> wrote:


On Thu, 7 Feb 2019, 01:36 fugee ohu <fugee279@gmail.com wrote:


On Wednesday, February 6, 2019 at 5:04:55 PM UTC-5, Colin Law wrote:
On Wed, 6 Feb 2019 at 21:42, fugee ohu <fuge...@gmail.com> wrote:
...
JSON::ParserError: 784: unexpected token at 'skuProducts=[{"skuAttr":"200007763:201336100;491:200004763#145cm","skuPropIds"

I understand why people get annoyed with your posts.  What is the point of posting a string that is obviously not valid JSON and telling us that it generates a parser error?  What else would you expect?

Colin



I think I have it working but I haven't figured out how to access the values from the json object yet
  data=JSON.load(skudata.to_json)
puts data["skuPropIds"]
just returns true

What value would you expect the puts method to return?

If you are worried about the fact that it did not appear to print the value of data["skuPropids"] then either you have found a bug in puts (which I think unlikely) or it did, in fact, print the value.  I think that it is more likely that it did print the value.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsGrBPRE5s5Z5XiMHPPcgWXSBUDUyLBeTwAfNQfwnBhAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment