Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created October 6, 2012 14:07
Show Gist options
  • Save coderforhire/3845014 to your computer and use it in GitHub Desktop.
Save coderforhire/3845014 to your computer and use it in GitHub Desktop.
Spice.post("/data/user_ips",@databag)
=> {"error"=>["Data Bag items must have an id matching /^[\\-[:alnum:]_]+$/, you gave: nil"]}
ruby-1.9.3-rc1 :141 > @databag = Spice.data_bag("user_ips")
=> #<Spice::DataBag:0x000000046092e0 @attrs={"name"=>"user_ips", "items"=>[]}>
ruby-1.9.3-rc1 :142 > @databag.items = [{id: "user-ips"}]
=> [{:id=>"user-ips"}]
ruby-1.9.3-rc1 :143 > Spice.post("/data/user_ips",@databag)
=> {"error"=>["Data Bag items must have an id matching /^[\\-[:alnum:]_]+$/, you gave: nil"]}
ruby-1.9.3-rc1 :144 > @databag.items
=> [{:id=>"user-ips"}]
ruby-1.9.3-rc1 :145 > @databag
=> #<Spice::DataBag:0x000000046092e0 @attrs={"name"=>"user_ips", "items"=>[{:id=>"user-ips"}]}>
ruby-1.9.3-rc1 :146 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment