Sha256: 941af73bb564ec91885f9312d4f78e45106aa87ae19e809303bdc131b8841d0e

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

#!/usr/bin/env ruby -rubygems

require File.dirname(__FILE__) + '/authentication'


# fetch the collection first
guidebook_collection = StorageRoom::Collection.find('4dda7761b65245fde100005d')
category_collection  = StorageRoom::Collection.find('4dda7761b65245fde100001a')

category = category_collection.entries.resources.first # find the first category
guidebook = guidebook_collection.entry_class.new(:title => 'Bar', :price => 2.23, :category => category)

if guidebook.save # save the guidebook with the associated category
  puts "Guidebook Entry saved (#{guidebook[:@url]})"
else
  puts "Guidebook could not be saved: #{entry2.errors.join(', ')}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
storage_room-0.3.0 examples/create_entry.rb